diff options
author | Tony Asleson <tasleson@redhat.com> | 2017-05-03 13:06:10 -0500 |
---|---|---|
committer | Tony Asleson <tasleson@redhat.com> | 2017-05-05 10:30:06 -0500 |
commit | 405a3689bcc40c8782685a739310e337a7c268a9 (patch) | |
tree | 33dc6742237968ef21d92559b8a66f26d212474f | |
parent | fcce7e16601caf3941fd0d090c03c94ac83a329e (diff) | |
download | lvm2-405a3689bcc40c8782685a739310e337a7c268a9.tar.gz |
lvmdbusd: Correct PV lookups
When a user does a Manager.PvCreate they can specify the block device using a
device path that may be different than what lvm reports is the device path. For
example a user could use:
/dev/disk/by-id/wwn-0x5002538500000000 instead of /dev/sdc
In this case the pvcreate will succeed, but when we query lvm we don't find the
newly created PV. We fail because it's device path is returned as /dev/sdc. This
change re-uses an internal lookup which can accommodate this and correctly find
the newly created PV.
Corrects https://bugzilla.redhat.com/show_bug.cgi?id=1445654
-rw-r--r-- | daemons/lvmdbusd/objectmanager.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/daemons/lvmdbusd/objectmanager.py b/daemons/lvmdbusd/objectmanager.py index a9d13a75d..563b9ec0e 100644 --- a/daemons/lvmdbusd/objectmanager.py +++ b/daemons/lvmdbusd/objectmanager.py @@ -223,8 +223,9 @@ class ObjectManager(AutomatedProperties): :param lvm_id: The lvm identifier """ with self.rlock: - if lvm_id in self._id_to_object_path: - return self.get_object_by_path(self._id_to_object_path[lvm_id]) + lookup_rc = self._id_lookup(lvm_id) + if lookup_rc: + return self.get_object_by_path(lookup_rc) return None def get_object_path_by_lvm_id(self, lvm_id): @@ -234,8 +235,9 @@ class ObjectManager(AutomatedProperties): :return: Object path or '/' if not found """ with self.rlock: - if lvm_id in self._id_to_object_path: - return self._id_to_object_path[lvm_id] + lookup_rc = self._id_lookup(lvm_id) + if lookup_rc: + return lookup_rc return '/' def _uuid_verify(self, path, uuid, lvm_id): |