]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume lvm.api be able to return a dictionary repr of a Volume object
authorAlfredo Deza <adeza@redhat.com>
Mon, 2 Oct 2017 16:35:13 +0000 (12:35 -0400)
committerAlfredo Deza <adeza@redhat.com>
Tue, 3 Oct 2017 13:00:13 +0000 (09:00 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
src/ceph-volume/ceph_volume/devices/lvm/api.py

index 0679639d4329877cf5514dd892f1698354dfa810..3a2187ae521fee36c93c86ad7d5a83604366ada5 100644 (file)
@@ -597,6 +597,15 @@ class Volume(object):
     def __repr__(self):
         return self.__str__()
 
+    def as_dict(self):
+        obj = {}
+        obj.update(self.lv_api)
+        obj['tags'] = self.tags
+        obj['name'] = self.name
+        obj['type'] = self.tags['ceph.type']
+        obj['path'] = self.lv_path
+        return obj
+
     def set_tags(self, tags):
         """
         :param tags: A dictionary of tag names and values, like::