From 61f8863e9b3e940936548174b6efff5b259ba205 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Thu, 13 Sep 2018 15:22:50 +0200 Subject: [PATCH] Excluding Datastores, which are NFS shares --- lib/cr_vmware_tpl/__init__.py | 2 +- lib/cr_vmware_tpl/handler.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) 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 -- 2.39.5