]> sourceware.org Git - lvm2.git/commitdiff
lvmdbustest.py: Use local data instead of fetching
authorTony Asleson <tasleson@redhat.com>
Mon, 14 Oct 2019 19:33:16 +0000 (14:33 -0500)
committerTony Asleson <tasleson@redhat.com>
Wed, 30 Oct 2019 15:38:40 +0000 (10:38 -0500)
Avoid making more dbus calls to get information we already have.  This
also avoids us getting an error where a dbus object representation is
being deleted by another process while we are trying to gather information
about it across the wire.

test/dbus/lvmdbustest.py

index 711b2476b52a13471f743bcf7427df9caed3a539..522e3ca135636a55c680ee4827e16c3169fe883e 100755 (executable)
@@ -88,8 +88,12 @@ def _root_pv_name(res, pv_name):
        vg_name = pv_name.split('/')[2]
        for v in res[VG_INT]:
                if v.Vg.Name == vg_name:
-                       pv = ClientProxy(bus, v.Vg.Pvs[0], interfaces=(PV_INT, ))
-                       return _root_pv_name(res, pv.Pv.Name)
+                       for pv in res[PV_INT]:
+                               if pv.object_path in v.Vg.Pvs:
+                                       return _root_pv_name(res, pv.Pv.Name)
+                       return None
+
+
 def _prune_lvs(res, interface, vg_object_path):
        lvs = [lv for lv in res[interface] if lv.LvCommon.Vg == vg_object_path]
        res[interface] = lvs
This page took 0.037617 seconds and 5 git commands to generate.