]> Frank Brehm's Git Trees - pixelpark/create-vmware-tpl.git/commitdiff
Excluding Datastores, which are NFS shares
authorFrank Brehm <frank.brehm@pixelpark.com>
Thu, 13 Sep 2018 13:22:50 +0000 (15:22 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Thu, 13 Sep 2018 13:22:50 +0000 (15:22 +0200)
lib/cr_vmware_tpl/__init__.py
lib/cr_vmware_tpl/handler.py

index 892def30c275b11e50667a99d79187af424709f8..3934b4245535bc542258ee1f7bdaa868c30ab747 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/env python3
 # -*- coding: utf-8 -*-
 
-__version__ = '0.1.0'
+__version__ = '0.1.1'
 
 # vim: ts=4 et list
index 315067c5c597db7005abef96f6623f99b3a595c5..5cb203307230e4c2d090d9255737f37859996b6b 100644 (file)
@@ -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