mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
lvmdbusd: Rename get_object_path_by_lvm_id
Renaming to get_object_path_by_uuid_lvm_id, to clarify that both the uuid and the lvm id are required.
This commit is contained in:
parent
41ebed7077
commit
b717e8fe1d
@ -100,7 +100,7 @@ class LvState(State):
|
||||
rc = []
|
||||
for pv in sorted(cfg.db.lv_contained_pv(uuid)):
|
||||
(pv_uuid, pv_name, pv_segs) = pv
|
||||
pv_obj = cfg.om.get_object_path_by_lvm_id(
|
||||
pv_obj = cfg.om.get_object_path_by_uuid_lvm_id(
|
||||
pv_uuid, pv_name, gen_new=False)
|
||||
rc.append((pv_obj, pv_segs))
|
||||
|
||||
@ -123,7 +123,7 @@ class LvState(State):
|
||||
|
||||
for l in cfg.db.hidden_lvs(self.Uuid):
|
||||
full_name = "%s/%s" % (vg_name, l[1])
|
||||
op = cfg.om.get_object_path_by_lvm_id(
|
||||
op = cfg.om.get_object_path_by_uuid_lvm_id(
|
||||
l[0], full_name, gen_new=False)
|
||||
assert op
|
||||
rc.append(op)
|
||||
@ -143,7 +143,7 @@ class LvState(State):
|
||||
else:
|
||||
self._segs.extend(set(segtypes))
|
||||
|
||||
self.Vg = cfg.om.get_object_path_by_lvm_id(
|
||||
self.Vg = cfg.om.get_object_path_by_uuid_lvm_id(
|
||||
vg_uuid, vg_name, vg_obj_path_generate)
|
||||
|
||||
self.Devices = LvState._pv_devices(self.Uuid)
|
||||
@ -151,7 +151,7 @@ class LvState(State):
|
||||
if PoolLv:
|
||||
gen = utils.lv_object_path_method(Name, (Attr, layout, role))
|
||||
|
||||
self.PoolLv = cfg.om.get_object_path_by_lvm_id(
|
||||
self.PoolLv = cfg.om.get_object_path_by_uuid_lvm_id(
|
||||
pool_lv_uuid, '%s/%s' % (vg_name, PoolLv),
|
||||
gen)
|
||||
else:
|
||||
@ -159,7 +159,7 @@ class LvState(State):
|
||||
|
||||
if OriginLv:
|
||||
self.OriginLv = \
|
||||
cfg.om.get_object_path_by_lvm_id(
|
||||
cfg.om.get_object_path_by_uuid_lvm_id(
|
||||
origin_uuid, '%s/%s' % (vg_name, OriginLv),
|
||||
vg_obj_path_generate)
|
||||
else:
|
||||
@ -192,7 +192,7 @@ class LvState(State):
|
||||
|
||||
def create_dbus_object(self, path):
|
||||
if not path:
|
||||
path = cfg.om.get_object_path_by_lvm_id(
|
||||
path = cfg.om.get_object_path_by_uuid_lvm_id(
|
||||
self.Uuid, self.lvm_id, self._object_path_create())
|
||||
|
||||
obj_ctor = self._object_type_create()
|
||||
|
@ -36,7 +36,7 @@ class Manager(AutomatedProperties):
|
||||
|
||||
# Check to see if we are already trying to create a PV for an existing
|
||||
# PV
|
||||
pv = cfg.om.get_object_path_by_lvm_id(
|
||||
pv = cfg.om.get_object_path_by_uuid_lvm_id(
|
||||
device, device, None, False)
|
||||
if pv:
|
||||
raise dbus.exceptions.DBusException(
|
||||
@ -159,7 +159,7 @@ class Manager(AutomatedProperties):
|
||||
:param key: The lookup value
|
||||
:return: Return the object path. If object not found you will get '/'
|
||||
"""
|
||||
p = cfg.om.get_object_path_by_lvm_id(
|
||||
p = cfg.om.get_object_path_by_uuid_lvm_id(
|
||||
key, key, gen_new=False)
|
||||
if p:
|
||||
return p
|
||||
|
@ -173,7 +173,7 @@ class ObjectManager(AutomatedProperties):
|
||||
def get_object_by_uuid_lvm_id(self, uuid, lvm_id):
|
||||
with self.rlock:
|
||||
return self.get_object_by_path(
|
||||
self.get_object_path_by_lvm_id(uuid, lvm_id, None, False))
|
||||
self.get_object_path_by_uuid_lvm_id(uuid, lvm_id, None, False))
|
||||
|
||||
def get_object_by_lvm_id(self, lvm_id):
|
||||
"""
|
||||
@ -212,8 +212,8 @@ class ObjectManager(AutomatedProperties):
|
||||
self._uuid_verify(path, uuid, lvm_identifier)
|
||||
return path
|
||||
|
||||
def get_object_path_by_lvm_id(self, uuid, lvm_id, path_create=None,
|
||||
gen_new=True):
|
||||
def get_object_path_by_uuid_lvm_id(self, uuid, lvm_id, path_create=None,
|
||||
gen_new=True):
|
||||
"""
|
||||
For a given lvm asset return the dbus object registered to it. If the
|
||||
object is not found and gen_new == True and path_create is a valid
|
||||
|
@ -65,7 +65,7 @@ class PvState(State):
|
||||
full_name = "%s/%s" % (vg_name, lv_name)
|
||||
|
||||
path_create = lv_object_path_method(lv_name, meta)
|
||||
lv_path = cfg.om.get_object_path_by_lvm_id(
|
||||
lv_path = cfg.om.get_object_path_by_uuid_lvm_id(
|
||||
lv_uuid, full_name, path_create)
|
||||
|
||||
rc.append((lv_path, segs))
|
||||
@ -83,7 +83,7 @@ class PvState(State):
|
||||
self.lv = self._lv_object_list(vg_name)
|
||||
|
||||
if vg_name:
|
||||
self.vg_path = cfg.om.get_object_path_by_lvm_id(
|
||||
self.vg_path = cfg.om.get_object_path_by_uuid_lvm_id(
|
||||
vg_uuid, vg_name, vg_obj_path_generate)
|
||||
else:
|
||||
self.vg_path = '/'
|
||||
@ -93,8 +93,8 @@ class PvState(State):
|
||||
|
||||
def create_dbus_object(self, path):
|
||||
if not path:
|
||||
path = cfg.om.get_object_path_by_lvm_id(self.Uuid, self.Name,
|
||||
pv_obj_path_generate)
|
||||
path = cfg.om.get_object_path_by_uuid_lvm_id(self.Uuid, self.Name,
|
||||
pv_obj_path_generate)
|
||||
return Pv(path, self)
|
||||
|
||||
# noinspection PyMethodMayBeStatic
|
||||
|
@ -66,7 +66,7 @@ class VgState(State):
|
||||
|
||||
gen = utils.lv_object_path_method(lv_name, meta)
|
||||
|
||||
lv_path = cfg.om.get_object_path_by_lvm_id(
|
||||
lv_path = cfg.om.get_object_path_by_uuid_lvm_id(
|
||||
lv_uuid, full_name, gen)
|
||||
rc.append(lv_path)
|
||||
return dbus.Array(rc, signature='o')
|
||||
@ -75,7 +75,7 @@ class VgState(State):
|
||||
rc = []
|
||||
for p in cfg.db.pvs_in_vg(self.Uuid):
|
||||
(pv_name, pv_uuid) = p
|
||||
rc.append(cfg.om.get_object_path_by_lvm_id(
|
||||
rc.append(cfg.om.get_object_path_by_uuid_lvm_id(
|
||||
pv_uuid, pv_name, pv_obj_path_generate))
|
||||
return dbus.Array(rc, signature='o')
|
||||
|
||||
@ -90,7 +90,7 @@ class VgState(State):
|
||||
|
||||
def create_dbus_object(self, path):
|
||||
if not path:
|
||||
path = cfg.om.get_object_path_by_lvm_id(
|
||||
path = cfg.om.get_object_path_by_uuid_lvm_id(
|
||||
self.Uuid, self.Name, vg_obj_path_generate)
|
||||
return Vg(path, self)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user