Revision c68d1f43
b/qa/ganeti-qa.py | ||
---|---|---|
28 | 28 |
""" |
29 | 29 |
|
30 | 30 |
import sys |
31 |
from datetime import datetime
|
|
32 |
from optparse import OptionParser
|
|
31 |
import datetime |
|
32 |
import optparse
|
|
33 | 33 |
|
34 | 34 |
import qa_cluster |
35 | 35 |
import qa_config |
... | ... | |
52 | 52 |
else: |
53 | 53 |
desc = '%r' % fn |
54 | 54 |
|
55 |
now = str(datetime.now()) |
|
55 |
now = str(datetime.datetime.now())
|
|
56 | 56 |
|
57 | 57 |
|
58 | 58 |
print '---', now, ('-' * (55 - len(now))) |
... | ... | |
218 | 218 |
"""Main program. |
219 | 219 |
|
220 | 220 |
""" |
221 |
parser = OptionParser(usage="%prog [options] <config-file>" |
|
222 |
" <known-hosts-file>") |
|
221 |
parser = optparse.OptionParser(usage="%prog [options] <config-file>"
|
|
222 |
" <known-hosts-file>")
|
|
223 | 223 |
parser.add_option('--dry-run', dest='dry_run', |
224 | 224 |
action="store_true", |
225 | 225 |
help="Show what would be done") |
b/qa/qa_cluster.py | ||
---|---|---|
1 |
# |
|
2 |
# |
|
3 |
|
|
1 | 4 |
# Copyright (C) 2007 Google Inc. |
2 | 5 |
# |
3 | 6 |
# This program is free software; you can redistribute it and/or modify |
b/qa/qa_config.py | ||
---|---|---|
1 |
# |
|
2 |
# |
|
3 |
|
|
1 | 4 |
# Copyright (C) 2007 Google Inc. |
2 | 5 |
# |
3 | 6 |
# This program is free software; you can redistribute it and/or modify |
b/qa/qa_daemon.py | ||
---|---|---|
1 |
# |
|
2 |
# |
|
3 |
|
|
1 | 4 |
# Copyright (C) 2007 Google Inc. |
2 | 5 |
# |
3 | 6 |
# This program is free software; you can redistribute it and/or modify |
b/qa/qa_env.py | ||
---|---|---|
1 |
# |
|
2 |
# |
|
3 |
|
|
1 | 4 |
# Copyright (C) 2007 Google Inc. |
2 | 5 |
# |
3 | 6 |
# This program is free software; you can redistribute it and/or modify |
b/qa/qa_error.py | ||
---|---|---|
1 |
# |
|
2 |
# |
|
3 |
|
|
1 | 4 |
# Copyright (C) 2007 Google Inc. |
2 | 5 |
# |
3 | 6 |
# This program is free software; you can redistribute it and/or modify |
b/qa/qa_instance.py | ||
---|---|---|
1 |
# |
|
2 |
# |
|
3 |
|
|
1 | 4 |
# Copyright (C) 2007 Google Inc. |
2 | 5 |
# |
3 | 6 |
# This program is free software; you can redistribute it and/or modify |
b/qa/qa_node.py | ||
---|---|---|
1 |
# |
|
2 |
# |
|
3 |
|
|
1 | 4 |
# Copyright (C) 2007 Google Inc. |
2 | 5 |
# |
3 | 6 |
# This program is free software; you can redistribute it and/or modify |
b/qa/qa_os.py | ||
---|---|---|
1 |
# |
|
2 |
# |
|
3 |
|
|
1 | 4 |
# Copyright (C) 2007 Google Inc. |
2 | 5 |
# |
3 | 6 |
# This program is free software; you can redistribute it and/or modify |
b/qa/qa_other.py | ||
---|---|---|
1 |
# |
|
2 |
# |
|
3 |
|
|
1 | 4 |
# Copyright (C) 2007 Google Inc. |
2 | 5 |
# |
3 | 6 |
# This program is free software; you can redistribute it and/or modify |
b/qa/qa_tags.py | ||
---|---|---|
1 |
# |
|
2 |
# |
|
3 |
|
|
1 | 4 |
# Copyright (C) 2007 Google Inc. |
2 | 5 |
# |
3 | 6 |
# This program is free software; you can redistribute it and/or modify |
b/qa/qa_utils.py | ||
---|---|---|
1 |
# |
|
2 |
# |
|
3 |
|
|
1 | 4 |
# Copyright (C) 2007 Google Inc. |
2 | 5 |
# |
3 | 6 |
# This program is free software; you can redistribute it and/or modify |
... | ... | |
88 | 91 |
def GetSSHCommand(node, cmd, strict=True): |
89 | 92 |
"""Builds SSH command to be executed. |
90 | 93 |
|
94 |
Args: |
|
95 |
- node: Node the command should run on |
|
96 |
- cmd: Command to be executed as a list with all parameters |
|
97 |
- strict: Whether to enable strict host key checking |
|
98 |
|
|
91 | 99 |
""" |
92 | 100 |
args = [ 'ssh', '-oEscapeChar=none', '-oBatchMode=yes', '-l', 'root' ] |
93 | 101 |
|
... | ... | |
191 | 199 |
|
192 | 200 |
""" |
193 | 201 |
master = qa_config.GetMasterNode() |
194 |
|
|
195 | 202 |
node_name = ResolveNodeName(node) |
196 | 203 |
|
197 | 204 |
# Get list of all instances |
... | ... | |
237 | 244 |
|
238 | 245 |
|
239 | 246 |
class QaHookContext: |
247 |
"""Definition of context passed to hooks. |
|
248 |
|
|
249 |
""" |
|
240 | 250 |
name = None |
241 | 251 |
phase = None |
242 | 252 |
success = None |
... | ... | |
267 | 277 |
|
268 | 278 |
Usage: prefix function with @qa_utils.DefineHook(...) |
269 | 279 |
|
270 |
This based on PEP 318, "Decorators for Functions and Methods". |
|
280 |
This is based on PEP 318, "Decorators for Functions and Methods".
|
|
271 | 281 |
|
272 | 282 |
""" |
273 | 283 |
def wrapper(fn): |
Also available in: Unified diff