]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
python-common: correctly dictify DriveGroupSpec objects when paths are used
authorJoshua Schmid <jschmid@suse.de>
Fri, 13 Mar 2020 13:21:22 +0000 (14:21 +0100)
committerJoshua Schmid <jschmid@suse.de>
Fri, 13 Mar 2020 13:21:22 +0000 (14:21 +0100)
Signed-off-by: Joshua Schmid <jschmid@suse.de>
src/python-common/ceph/deployment/drive_group.py

index 6fe625f93657d88ec7a763aba49af1b005ba9be3..4be240e257c4d22c1f8d135a20fcc00f18499b00 100644 (file)
@@ -87,7 +87,11 @@ class DeviceSelection(object):
         return cls(**device_spec)
 
     def to_json(self):
-        return self.__dict__.copy()
+        # type: () -> Dict[str, Any]
+        c = self.__dict__.copy()
+        if self.paths:
+            c['paths'] = [p.path for p in self.paths]
+        return c
 
     def __repr__(self):
         keys = [