"""
import sys
-from datetime import datetime
-from optparse import OptionParser
+import datetime
+import optparse
import qa_cluster
import qa_config
else:
desc = '%r' % fn
- now = str(datetime.now())
+ now = str(datetime.datetime.now())
print
print '---', now, ('-' * (55 - len(now)))
"""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")
+#
+#
+
# Copyright (C) 2007 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
+#
+#
+
# Copyright (C) 2007 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
+#
+#
+
# Copyright (C) 2007 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
+#
+#
+
# Copyright (C) 2007 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
+#
+#
+
# Copyright (C) 2007 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
+#
+#
+
# Copyright (C) 2007 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
+#
+#
+
# Copyright (C) 2007 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
+#
+#
+
# Copyright (C) 2007 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
+#
+#
+
# Copyright (C) 2007 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
+#
+#
+
# Copyright (C) 2007 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
+#
+#
+
# Copyright (C) 2007 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
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' ]
"""
master = qa_config.GetMasterNode()
-
node_name = ResolveNodeName(node)
# Get list of all instances
class QaHookContext:
+ """Definition of context passed to hooks.
+
+ """
name = None
phase = None
success = None
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):