Revision c68d1f43 qa/qa_utils.py
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