From: Alfredo Deza Date: Mon, 2 Oct 2017 16:35:13 +0000 (-0400) Subject: ceph-volume lvm.api be able to return a dictionary repr of a Volume object X-Git-Tag: v13.0.1~689^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0cae22750f396d1c1664875edb2742c50a41bffd;p=ceph.git ceph-volume lvm.api be able to return a dictionary repr of a Volume object Signed-off-by: Alfredo Deza --- diff --git a/src/ceph-volume/ceph_volume/devices/lvm/api.py b/src/ceph-volume/ceph_volume/devices/lvm/api.py index 0679639d4329..3a2187ae521f 100644 --- a/src/ceph-volume/ceph_volume/devices/lvm/api.py +++ b/src/ceph-volume/ceph_volume/devices/lvm/api.py @@ -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::