summaryrefslogtreecommitdiff
path: root/daemons/lvmdbusd/manager.py
diff options
context:
space:
mode:
authorTony Asleson <tasleson@redhat.com>2016-11-01 17:52:18 -0500
committerTony Asleson <tasleson@redhat.com>2016-11-02 16:39:03 -0500
commit60de09b00caf034367278adea420b67700c01b71 (patch)
treeb5a641c1f7a2817fec9cddf71b76b82100e7b8f3 /daemons/lvmdbusd/manager.py
parent38dd79307a51faedb75e092a7913781e6eb88902 (diff)
downloadlvm2-60de09b00caf034367278adea420b67700c01b71.tar.gz
lvmdbusd: Don't use dbus lib in worker thread
Simplify the code paths so that we don't utilize the dbus library code when we are in worker thread context. ref. https://bugs.freedesktop.org/show_bug.cgi?id=98521
Diffstat (limited to 'daemons/lvmdbusd/manager.py')
-rw-r--r--daemons/lvmdbusd/manager.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/daemons/lvmdbusd/manager.py b/daemons/lvmdbusd/manager.py
index e3774425b..e81ee1f05 100644
--- a/daemons/lvmdbusd/manager.py
+++ b/daemons/lvmdbusd/manager.py
@@ -42,12 +42,10 @@ class Manager(AutomatedProperties):
raise dbus.exceptions.DBusException(
MANAGER_INTERFACE, "PV Already exists!")
- created_pv = []
rc, out, err = cmdhandler.pv_create(create_options, [device])
if rc == 0:
- pvs = load_pvs([device], emit_signal=True)[0]
- for p in pvs:
- created_pv = p.dbus_object_path()
+ cfg.load()
+ created_pv = cfg.om.get_object_path_by_lvm_id(device)
else:
raise dbus.exceptions.DBusException(
MANAGER_INTERFACE,
@@ -80,20 +78,14 @@ class Manager(AutomatedProperties):
MANAGER_INTERFACE, 'object path = %s not found' % p)
rc, out, err = cmdhandler.vg_create(create_options, pv_devices, name)
- created_vg = "/"
if rc == 0:
- vgs = load_vgs([name], emit_signal=True)[0]
- for v in vgs:
- created_vg = v.dbus_object_path()
-
- # Update the PVS
- load_pvs(refresh=True, emit_signal=True, cache_refresh=False)
+ cfg.load()
+ return cfg.om.get_object_path_by_lvm_id(name)
else:
raise dbus.exceptions.DBusException(
MANAGER_INTERFACE,
'Exit code %s, stderr = %s' % (str(rc), err))
- return created_vg
@dbus.service.method(
dbus_interface=MANAGER_INTERFACE,