Nir Soffer has posted comments on this change.
Change subject: lvm: Raise an exception if missing physical volume ......................................................................
Patch Set 8:
(6 comments)
Commit message need rewrite.
https://gerrit.ovirt.org/#/c/27442/8//COMMIT_MSG Commit Message:
Line 6: Line 7: lvm: Raise an exception if missing physical volume Line 8: Line 9: Raise an exception when reading metatada from a missing or deactivated Line 10: physical volume. Raise InaccessiblePhysicalDev when getting a pv which is not in lvm cache.
There is no such thing as deactivated physical volume. Line 11: Line 12: When VDSM tries to read metadata from a physical volume using the getPV Line 13: methon in lvm.py, due to the possibility that that physical volume is not Line 14: accessible anymore, we should raise an exception.
Line 8: Line 9: Raise an exception when reading metatada from a missing or deactivated Line 10: physical volume. Line 11: Line 12: When VDSM tries to read metadata from a physical volume using the getPV VDSM does not try to read metadata from a physical volume, it tries to get a cached PV object from lvm cache.
Please use modulename.functionName() - lvm.getPV() Line 13: methon in lvm.py, due to the possibility that that physical volume is not Line 14: accessible anymore, we should raise an exception. Line 15: Line 16: This patch addresses these issues:
Line 9: Raise an exception when reading metatada from a missing or deactivated Line 10: physical volume. Line 11: Line 12: When VDSM tries to read metadata from a physical volume using the getPV Line 13: methon in lvm.py, due to the possibility that that physical volume is not methon -> function, but if you write lvm.getPV(), you don't need to write "getPV function in lvm.py". Line 14: accessible anymore, we should raise an exception. Line 15: Line 16: This patch addresses these issues: Line 17: * The method _getDeviceList() in hsm.py already expects a StorageException
Line 10: physical volume. Line 11: Line 12: When VDSM tries to read metadata from a physical volume using the getPV Line 13: methon in lvm.py, due to the possibility that that physical volume is not Line 14: accessible anymore, we should raise an exception. we should raise a relevant storage exception, instead of letting the code fail at some random point later when trying to access an attribute of None object. Line 15: Line 16: This patch addresses these issues: Line 17: * The method _getDeviceList() in hsm.py already expects a StorageException Line 18: when getPV fails to read the physical volume.
Line 14: accessible anymore, we should raise an exception. Line 15: Line 16: This patch addresses these issues: Line 17: * The method _getDeviceList() in hsm.py already expects a StorageException Line 18: when getPV fails to read the physical volume. There was no issue in this method, so this did not fix anything in _getDeviceList(). You patch just updated it to the new api (raise instead of returning None) Line 19: * __processVGInfos in hsm.py and getMetadataMapping in blockSD.py don't Line 20: implement checks to assure the pv object returned by getPV is not None. Line 21: Line 22: Change-Id: I9932b044c8b439dc8b1f09191a5d89f4bc44c38a
Line 16: This patch addresses these issues: Line 17: * The method _getDeviceList() in hsm.py already expects a StorageException Line 18: when getPV fails to read the physical volume. Line 19: * __processVGInfos in hsm.py and getMetadataMapping in blockSD.py don't Line 20: implement checks to assure the pv object returned by getPV is not None. Lets simplify - did not handle the case when pv was missing which cause the flow to fail with AttributeError. Now they do not fail and log warning about missing pvs. Line 21: Line 22: Change-Id: I9932b044c8b439dc8b1f09191a5d89f4bc44c38a Line 23: Bug-Url: https://bugzilla.redhat.com/1048696 Line 24: Signed-off-by: Xavi Francisco xfrancis@redhat.com