mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
lvmdbusd: _lv_create, simplify return path
This commit is contained in:
parent
cd28717f24
commit
24fd1dd7a3
@ -738,15 +738,13 @@ class LvThinPool(Lv):
|
|||||||
# Make sure we have a dbus object representing it
|
# Make sure we have a dbus object representing it
|
||||||
dbo = cfg.om.get_object_by_uuid_lvm_id(lv_uuid, lv_name)
|
dbo = cfg.om.get_object_by_uuid_lvm_id(lv_uuid, lv_name)
|
||||||
|
|
||||||
lv_created = '/'
|
|
||||||
|
|
||||||
if dbo:
|
if dbo:
|
||||||
rc, out, err = cmdhandler.lv_lv_create(
|
rc, out, err = cmdhandler.lv_lv_create(
|
||||||
lv_name, create_options, name, size_bytes)
|
lv_name, create_options, name, size_bytes)
|
||||||
if rc == 0:
|
if rc == 0:
|
||||||
full_name = "%s/%s" % (dbo.vg_name_lookup(), name)
|
full_name = "%s/%s" % (dbo.vg_name_lookup(), name)
|
||||||
cfg.load()
|
cfg.load()
|
||||||
lv_created = cfg.om.get_object_path_by_lvm_id(full_name)
|
return cfg.om.get_object_path_by_lvm_id(full_name)
|
||||||
else:
|
else:
|
||||||
raise dbus.exceptions.DBusException(
|
raise dbus.exceptions.DBusException(
|
||||||
LV_INTERFACE,
|
LV_INTERFACE,
|
||||||
@ -756,7 +754,6 @@ class LvThinPool(Lv):
|
|||||||
LV_INTERFACE,
|
LV_INTERFACE,
|
||||||
'LV with uuid %s and name %s not present!' %
|
'LV with uuid %s and name %s not present!' %
|
||||||
(lv_uuid, lv_name))
|
(lv_uuid, lv_name))
|
||||||
return lv_created
|
|
||||||
|
|
||||||
@dbus.service.method(
|
@dbus.service.method(
|
||||||
dbus_interface=THIN_POOL_INTERFACE,
|
dbus_interface=THIN_POOL_INTERFACE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user