]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
python-common: only validate host_pattern if present
authorJoshua Schmid <jschmid@suse.de>
Thu, 30 Apr 2020 13:05:31 +0000 (15:05 +0200)
committerSebastian Wagner <sebastian.wagner@suse.com>
Mon, 8 Jun 2020 11:52:24 +0000 (13:52 +0200)
Signed-off-by: Joshua Schmid <jschmid@suse.de>
(cherry picked from commit 3b771811859b56bf004f5016fa0fb9173c417865)

src/python-common/ceph/deployment/drive_group.py

index 0b5b489de98d0820da8c90d25ca9645c349a25dc..43ae10546ea41a3a940cb1cbf66623c473a2415c 100644 (file)
@@ -241,7 +241,8 @@ class DriveGroupSpec(ServiceSpec):
         # type: () -> None
         super(DriveGroupSpec, self).validate()
 
-        if not isinstance(self.placement.host_pattern, six.string_types):
+        if not isinstance(self.placement.host_pattern, six.string_types) and \
+                self.placement.host_pattern is not None:
             raise DriveGroupValidationError('host_pattern must be of type string')
 
         specs = [self.data_devices, self.db_devices, self.wal_devices, self.journal_devices]