Commit c68d1f43 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Code style updates for QA code.

Reviewed-by: iustinp
parent c3f9340c
...@@ -28,8 +28,8 @@ Example: ssh-keyscan -t rsa node{1,2,3,4}.example.com > known_hosts ...@@ -28,8 +28,8 @@ Example: ssh-keyscan -t rsa node{1,2,3,4}.example.com > known_hosts
""" """
import sys import sys
from datetime import datetime import datetime
from optparse import OptionParser import optparse
import qa_cluster import qa_cluster
import qa_config import qa_config
...@@ -52,7 +52,7 @@ def RunTest(fn, *args): ...@@ -52,7 +52,7 @@ def RunTest(fn, *args):
else: else:
desc = '%r' % fn desc = '%r' % fn
now = str(datetime.now()) now = str(datetime.datetime.now())
print print
print '---', now, ('-' * (55 - len(now))) print '---', now, ('-' * (55 - len(now)))
...@@ -218,8 +218,8 @@ def main(): ...@@ -218,8 +218,8 @@ def main():
"""Main program. """Main program.
""" """
parser = OptionParser(usage="%prog [options] <config-file>" parser = optparse.OptionParser(usage="%prog [options] <config-file>"
" <known-hosts-file>") " <known-hosts-file>")
parser.add_option('--dry-run', dest='dry_run', parser.add_option('--dry-run', dest='dry_run',
action="store_true", action="store_true",
help="Show what would be done") help="Show what would be done")
......
#
#
# Copyright (C) 2007 Google Inc. # Copyright (C) 2007 Google Inc.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
......
#
#
# Copyright (C) 2007 Google Inc. # Copyright (C) 2007 Google Inc.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
......
#
#
# Copyright (C) 2007 Google Inc. # Copyright (C) 2007 Google Inc.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
......
#
#
# Copyright (C) 2007 Google Inc. # Copyright (C) 2007 Google Inc.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
......
#
#
# Copyright (C) 2007 Google Inc. # Copyright (C) 2007 Google Inc.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
......
#
#
# Copyright (C) 2007 Google Inc. # Copyright (C) 2007 Google Inc.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
......
#
#
# Copyright (C) 2007 Google Inc. # Copyright (C) 2007 Google Inc.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
......
#
#
# Copyright (C) 2007 Google Inc. # Copyright (C) 2007 Google Inc.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
......
#
#
# Copyright (C) 2007 Google Inc. # Copyright (C) 2007 Google Inc.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
......
#
#
# Copyright (C) 2007 Google Inc. # Copyright (C) 2007 Google Inc.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
......
#
#
# Copyright (C) 2007 Google Inc. # Copyright (C) 2007 Google Inc.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
...@@ -88,6 +91,11 @@ def AssertNotEqual(first, second): ...@@ -88,6 +91,11 @@ def AssertNotEqual(first, second):
def GetSSHCommand(node, cmd, strict=True): def GetSSHCommand(node, cmd, strict=True):
"""Builds SSH command to be executed. """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' ] args = [ 'ssh', '-oEscapeChar=none', '-oBatchMode=yes', '-l', 'root' ]
...@@ -191,7 +199,6 @@ def GetNodeInstances(node, secondaries=False): ...@@ -191,7 +199,6 @@ def GetNodeInstances(node, secondaries=False):
""" """
master = qa_config.GetMasterNode() master = qa_config.GetMasterNode()
node_name = ResolveNodeName(node) node_name = ResolveNodeName(node)
# Get list of all instances # Get list of all instances
...@@ -237,6 +244,9 @@ def LoadHooks(): ...@@ -237,6 +244,9 @@ def LoadHooks():
class QaHookContext: class QaHookContext:
"""Definition of context passed to hooks.
"""
name = None name = None
phase = None phase = None
success = None success = None
...@@ -267,7 +277,7 @@ def DefineHook(name): ...@@ -267,7 +277,7 @@ def DefineHook(name):
Usage: prefix function with @qa_utils.DefineHook(...) 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): def wrapper(fn):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment