diff --git a/qa/ganeti-qa.py b/qa/ganeti-qa.py index f44dbec72804192f6aeb81507ce921376c68387d..42b95b8433fd4cc9384a4a930d9894f128139c16 100755 --- a/qa/ganeti-qa.py +++ b/qa/ganeti-qa.py @@ -28,8 +28,8 @@ Example: ssh-keyscan -t rsa node{1,2,3,4}.example.com > known_hosts """ import sys -from datetime import datetime -from optparse import OptionParser +import datetime +import optparse import qa_cluster import qa_config @@ -52,7 +52,7 @@ def RunTest(fn, *args): else: desc = '%r' % fn - now = str(datetime.now()) + now = str(datetime.datetime.now()) print print '---', now, ('-' * (55 - len(now))) @@ -218,8 +218,8 @@ def main(): """Main program. """ - parser = OptionParser(usage="%prog [options] <config-file>" - " <known-hosts-file>") + parser = optparse.OptionParser(usage="%prog [options] <config-file>" + " <known-hosts-file>") parser.add_option('--dry-run', dest='dry_run', action="store_true", help="Show what would be done") diff --git a/qa/qa_cluster.py b/qa/qa_cluster.py index 08868fd5eb6ad85dfed2133c7641bfef34f70194..70d1c4386b76a100eadd2bba353bd198ff86196f 100644 --- a/qa/qa_cluster.py +++ b/qa/qa_cluster.py @@ -1,3 +1,6 @@ +# +# + # Copyright (C) 2007 Google Inc. # # This program is free software; you can redistribute it and/or modify diff --git a/qa/qa_config.py b/qa/qa_config.py index a180b329aa11357bebb076c942f5bcb799a8225d..54bd5626a3f6fb533f2bb9fa17e65bdc943a9627 100644 --- a/qa/qa_config.py +++ b/qa/qa_config.py @@ -1,3 +1,6 @@ +# +# + # Copyright (C) 2007 Google Inc. # # This program is free software; you can redistribute it and/or modify diff --git a/qa/qa_daemon.py b/qa/qa_daemon.py index 19b7d8250cba36278e692ab9ca0b42cecd33a6c0..30bb657e61a96c4a33ad8312c67b9d4aa0b71206 100644 --- a/qa/qa_daemon.py +++ b/qa/qa_daemon.py @@ -1,3 +1,6 @@ +# +# + # Copyright (C) 2007 Google Inc. # # This program is free software; you can redistribute it and/or modify diff --git a/qa/qa_env.py b/qa/qa_env.py index 86ad5909a7b0ae8d0915cc68b086e9ee8de03bd8..540363d3a071d767cd7b18ced582e898e1f919ba 100644 --- a/qa/qa_env.py +++ b/qa/qa_env.py @@ -1,3 +1,6 @@ +# +# + # Copyright (C) 2007 Google Inc. # # This program is free software; you can redistribute it and/or modify diff --git a/qa/qa_error.py b/qa/qa_error.py index d2885477e6954abf4b298a497d34463278a2cd00..eb9131cb34f830a658ea6eeeea962587e88723a9 100644 --- a/qa/qa_error.py +++ b/qa/qa_error.py @@ -1,3 +1,6 @@ +# +# + # Copyright (C) 2007 Google Inc. # # This program is free software; you can redistribute it and/or modify diff --git a/qa/qa_instance.py b/qa/qa_instance.py index 12906bb105a00d741ce8d3e9141fc199148e6697..53f56d3cadeeb25563c6b6cb6aae631b5af40c7e 100644 --- a/qa/qa_instance.py +++ b/qa/qa_instance.py @@ -1,3 +1,6 @@ +# +# + # Copyright (C) 2007 Google Inc. # # This program is free software; you can redistribute it and/or modify diff --git a/qa/qa_node.py b/qa/qa_node.py index be5edcd0b22050aa235e2e49131cdfd255e8830f..26eccebceee635bbc71c5483cba0e62a9530e1bd 100644 --- a/qa/qa_node.py +++ b/qa/qa_node.py @@ -1,3 +1,6 @@ +# +# + # Copyright (C) 2007 Google Inc. # # This program is free software; you can redistribute it and/or modify diff --git a/qa/qa_os.py b/qa/qa_os.py index 16d77df99e41b5da5768d7c503a5863e475ac46f..fbdaa27e631657bc06ff759ee6ead1c1973a3322 100644 --- a/qa/qa_os.py +++ b/qa/qa_os.py @@ -1,3 +1,6 @@ +# +# + # Copyright (C) 2007 Google Inc. # # This program is free software; you can redistribute it and/or modify diff --git a/qa/qa_other.py b/qa/qa_other.py index d349a066c64b01a26a913a85ef8286b561ced458..ab7a8984ad390a9e01cf5aa4ddfb9aced572c345 100644 --- a/qa/qa_other.py +++ b/qa/qa_other.py @@ -1,3 +1,6 @@ +# +# + # Copyright (C) 2007 Google Inc. # # This program is free software; you can redistribute it and/or modify diff --git a/qa/qa_tags.py b/qa/qa_tags.py index 9770288b0a18b8da98f08a785b336a07c47ee396..5bef531d604ae43de8237b477f2e718fcebdb539 100644 --- a/qa/qa_tags.py +++ b/qa/qa_tags.py @@ -1,3 +1,6 @@ +# +# + # Copyright (C) 2007 Google Inc. # # This program is free software; you can redistribute it and/or modify diff --git a/qa/qa_utils.py b/qa/qa_utils.py index 9384a6c4ba491daa6988abeb253e759a7fdb51f8..2005634351dcf59a916897cc25dcd6bb7a6c124e 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,7 +277,7 @@ def DefineHook(name): Usage: prefix function with @qa_utils.DefineHook(...) - This based on PEP 318, "Decorators for Functions and Methods". + This is based on PEP 318, "Decorators for Functions and Methods". """ def wrapper(fn):