Nir Soffer has uploaded a new change for review. Change subject: lvm: Fail loudly if called with unexptected input. ......................................................................
lvm: Fail loudly if called with unexptected input. When creating pvs with the force option, we are very carefull to accept only True. When using the jsonrpc transport, engine was sending "true" and "false", causing the call to fail misteiously. Now we are also carefull about rejecting invlid input, making debugging easier. Change-Id: If9e6754d4aa2efaf894a9309cfaa4595d710063b Signed-off-by: Nir Soffer <[email protected]> --- M vdsm/storage/lvm.py 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/29/37329/1 diff --git a/vdsm/storage/lvm.py b/vdsm/storage/lvm.py index aa3c04b..549839a 100644 --- a/vdsm/storage/lvm.py +++ b/vdsm/storage/lvm.py @@ -724,6 +724,11 @@ else: raise + # We must be very carefull here; any value execpt True or False is a user + # error. + if type(force) != bool: + raise ValueError("Invalid value for 'force': %r" % force) + if force is True: options = ("-y", "-ff") _initpvs_removeHolders() -- To view, visit http://gerrit.ovirt.org/37329 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If9e6754d4aa2efaf894a9309cfaa4595d710063b Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
