X-Git-Url: https://code.grnet.gr/git/ganeti-local/blobdiff_plain/f9fe750a1f6de02492d917c6f80de0a1998fe667..cdb08f4409c7ce42803a269d2d9ea30ea5bcd0f2:/qa/qa_utils.py diff --git a/qa/qa_utils.py b/qa/qa_utils.py index 463240c..2005634 100644 --- a/qa/qa_utils.py +++ b/qa/qa_utils.py @@ -1,3 +1,6 @@ +# +# + # Copyright (C) 2007 Google Inc. # # This program is free software; you can redistribute it and/or modify @@ -88,6 +91,11 @@ def AssertNotEqual(first, second): def GetSSHCommand(node, cmd, strict=True): """Builds SSH command to be executed. + Args: + - node: Node the command should run on + - cmd: Command to be executed as a list with all parameters + - strict: Whether to enable strict host key checking + """ args = [ 'ssh', '-oEscapeChar=none', '-oBatchMode=yes', '-l', 'root' ] @@ -191,7 +199,6 @@ def GetNodeInstances(node, secondaries=False): """ master = qa_config.GetMasterNode() - node_name = ResolveNodeName(node) # Get list of all instances @@ -237,6 +244,9 @@ def LoadHooks(): class QaHookContext: + """Definition of context passed to hooks. + + """ name = None phase = None success = None @@ -267,6 +277,8 @@ def DefineHook(name): Usage: prefix function with @qa_utils.DefineHook(...) + This is based on PEP 318, "Decorators for Functions and Methods". + """ def wrapper(fn): def new_f(*args, **kwargs):