From 1f4b9d3972962d3ffad4b381cadf92d4b7202cde Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Mon, 4 Feb 2013 11:12:23 +0100 Subject: [PATCH] Switch KVM to multi-error verify results This uses the new _FormatVerifyResults helper function to return multiple errors. Signed-off-by: Iustin Pop <iustin@google.com> Reviewed-by: Michael Hanselmann <hansmi@google.com> --- lib/hypervisor/hv_kvm.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/hypervisor/hv_kvm.py b/lib/hypervisor/hv_kvm.py index 1fe502eb4..26aacfdfa 100644 --- a/lib/hypervisor/hv_kvm.py +++ b/lib/hypervisor/hv_kvm.py @@ -1,7 +1,7 @@ # # -# Copyright (C) 2008, 2009, 2010, 2011, 2012 Google Inc. +# Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -2034,14 +2034,17 @@ class KVMHypervisor(hv_base.BaseHypervisor): @return: Problem description if something is wrong, C{None} otherwise """ - # FIXME: this is the global kvm version, but the actual version can be - # customized as an hv parameter. we should use the nodegroup's default kvm - # path parameter here. + msgs = [] + # FIXME: this is the global kvm binary, but the actual path can be + # customized as an hv parameter; we should use the nodegroup's + # default kvm path parameter here. if not os.path.exists(constants.KVM_PATH): - return "The KVM binary ('%s') does not exist" % constants.KVM_PATH + msgs.append("The KVM binary ('%s') does not exist" % constants.KVM_PATH) if not os.path.exists(constants.SOCAT_PATH): - return "The socat binary ('%s') does not exist" % constants.SOCAT_PATH - return None + msgs.append("The socat binary ('%s') does not exist" % + constants.SOCAT_PATH) + + return self._FormatVerifyResults(msgs) @classmethod def CheckParameterSyntax(cls, hvparams): -- GitLab