#
#
-# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2012 Google Inc.
+# Copyright (C) 2006, 2007, 2008, 2009, 2010, 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
"""Reboot an instance."""
raise NotImplementedError
- def ListInstances(self):
+ def ListInstances(self, hvparams=None):
"""Get the list of running instances."""
raise NotImplementedError
return (cls.ANCILLARY_FILES, cls.ANCILLARY_FILES_OPT)
- def Verify(self):
+ def Verify(self, hvparams=None):
"""Verify the hypervisor.
+ @type hvparams: dict of strings
+ @param hvparams: hypervisor parameters to be verified against
+
@return: Problem description if something is wrong, C{None} otherwise
"""
result = utils.RunCmd(["reboot", "-n", "-f"])
if not result:
logging.error("Can't run shutdown: %s", result.output)
+
+ @staticmethod
+ def _FormatVerifyResults(msgs):
+ """Formats the verification results, given a list of errors.
+
+ @param msgs: list of errors, possibly empty
+ @return: overall problem description if something is wrong,
+ C{None} otherwise
+
+ """
+ if msgs:
+ return "; ".join(msgs)
+ else:
+ return None