mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
lvmdbusd: Correct get_object_path_by_uuid_lvm_id
When checking to see if the PV is missing we incorrectly checked that the path_create was equal to PV creation. However, there are cases where we are doing a lookup where the path_create == None. In this case, we would fail to set lvm_id == None which caused a problem as we had more than 1 PV that was missing. When this occurred, the second lookup matched the first missing PV that was added to the object manager. This resulted in the following: Traceback (most recent call last): File "/usr/lib/python3.9/site-packages/lvmdbusd/utils.py", line 667, in _run self.rc = self.f(*self.args) File "/usr/lib/python3.9/site-packages/lvmdbusd/fetch.py", line 25, in _main_thread_load (changes, remove) = load_pvs( File "/usr/lib/python3.9/site-packages/lvmdbusd/pv.py", line 46, in load_pvs return common( File "/usr/lib/python3.9/site-packages/lvmdbusd/loader.py", line 55, in common del existing_paths[dbus_object.dbus_object_path()] Because we expect to find the object in existing_paths if we found it in the lookup. resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2085078
This commit is contained in:
parent
a0fc61177e
commit
d88998f516
@ -360,10 +360,13 @@ class DataStore(object):
|
|||||||
return rc
|
return rc
|
||||||
|
|
||||||
def pv_missing(self, pv_uuid):
|
def pv_missing(self, pv_uuid):
|
||||||
|
# The uuid might not be a PV, default to false
|
||||||
if pv_uuid in self.pvs:
|
if pv_uuid in self.pvs:
|
||||||
if self.pvs[pv_uuid]['pv_missing'] == '':
|
if self.pvs[pv_uuid]['pv_missing'] == '':
|
||||||
return False
|
return False
|
||||||
|
else:
|
||||||
return True
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def fetch_vgs(self, vg_name):
|
def fetch_vgs(self, vg_name):
|
||||||
if not vg_name:
|
if not vg_name:
|
||||||
|
@ -300,10 +300,9 @@ class ObjectManager(AutomatedProperties):
|
|||||||
|
|
||||||
# If a PV is missing its device path is '[unknown]' or some
|
# If a PV is missing its device path is '[unknown]' or some
|
||||||
# other text derivation of unknown. When we find that a PV is
|
# other text derivation of unknown. When we find that a PV is
|
||||||
# missing we will clear out the lvm_id as it's likely not unique
|
# missing we will clear out the lvm_id as it's not unique
|
||||||
# and thus not useful and potentially harmful for lookups.
|
# and thus not useful and harmful for lookups.
|
||||||
if path_create == pv_obj_path_generate and \
|
if cfg.db.pv_missing(uuid):
|
||||||
cfg.db.pv_missing(uuid):
|
|
||||||
lvm_id = None
|
lvm_id = None
|
||||||
|
|
||||||
# Lets check for the uuid first
|
# Lets check for the uuid first
|
||||||
|
Loading…
Reference in New Issue
Block a user