From: Frank Brehm Date: Thu, 13 Sep 2018 13:22:50 +0000 (+0200) Subject: Excluding Datastores, which are NFS shares X-Git-Tag: 0.1.1^2 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=61f8863e9b3e940936548174b6efff5b259ba205;p=pixelpark%2Fcreate-vmware-tpl.git Excluding Datastores, which are NFS shares --- diff --git a/lib/cr_vmware_tpl/__init__.py b/lib/cr_vmware_tpl/__init__.py index 892def3..3934b42 100644 --- a/lib/cr_vmware_tpl/__init__.py +++ b/lib/cr_vmware_tpl/__init__.py @@ -1,6 +1,6 @@ #!/bin/env python3 # -*- coding: utf-8 -*- -__version__ = '0.1.0' +__version__ = '0.1.1' # vim: ts=4 et list diff --git a/lib/cr_vmware_tpl/handler.py b/lib/cr_vmware_tpl/handler.py index 315067c..5cb2033 100644 --- a/lib/cr_vmware_tpl/handler.py +++ b/lib/cr_vmware_tpl/handler.py @@ -36,7 +36,7 @@ from .obj import PpBaseObject from .config import CrTplConfiguration -__version__ = '0.9.2' +__version__ = '0.9.2.1' LOG = logging.getLogger(__name__) TZ = pytz.timezone('Europe/Berlin') @@ -137,6 +137,7 @@ class CrTplHandler(PpBaseObject): max_depth = 10 re_local_ds = re.compile(r'^local[_-]', re.IGNORECASE) + re_share_nfs_ds = re.compile(r'(?:share[_-]*nfs|nfs[_-]*share)', re.IGNORECASE) # ------------------------------------------------------------------------- def __init__( @@ -539,6 +540,10 @@ class CrTplHandler(PpBaseObject): if self.verbose > 2: LOG.debug("Datastore {!r} seems to be local.".format(child.summary.name)) return + if self.re_share_nfs_ds.search(child.summary.name): + if self.verbose > 2: + LOG.debug("Datastore {!r} seems to be a NFS share.".format(child.summary.name)) + return if child.summary.name in self.config.excluded_datastores: LOG.debug("Datastore {!r} is excluded.".format(child.summary.name)) return