projects
/
ganeti-local
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cluster: add nicparams, and update them on upgrade
[ganeti-local]
/
qa
/
qa_utils.py
diff --git
a/qa/qa_utils.py
b/qa/qa_utils.py
index
70650c1
..
fbc92e8
100644
(file)
--- 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
# Copyright (C) 2007 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
@@
-65,6
+68,14
@@
def _SetupColours():
_SetupColours()
_SetupColours()
+def AssertIn(item, sequence):
+ """Raises an error when item is not in sequence.
+
+ """
+ if item not in sequence:
+ raise qa_error.Error('%r not in %r' % (item, sequence))
+
+
def AssertEqual(first, second):
"""Raises an error when values aren't equal.
def AssertEqual(first, second):
"""Raises an error when values aren't equal.
@@
-84,8
+95,13
@@
def AssertNotEqual(first, second):
def GetSSHCommand(node, cmd, strict=True):
"""Builds SSH command to be executed.
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' ]
+ args = [ 'ssh', '-oEscapeChar=none', '-oBatchMode=yes', '-l', 'root', '-t' ]
if strict:
tmp = 'yes'
if strict:
tmp = 'yes'
@@
-95,13
+111,7
@@
def GetSSHCommand(node, cmd, strict=True):
args.append('-oClearAllForwardings=yes')
args.append('-oForwardAgent=yes')
args.append(node)
args.append('-oClearAllForwardings=yes')
args.append('-oForwardAgent=yes')
args.append(node)
-
- if qa_config.options.dry_run:
- prefix = 'exit 0; '
- else:
- prefix = ''
-
- args.append(prefix + cmd)
+ args.append(cmd)
print 'SSH:', utils.ShellQuoteArgs(args)
print 'SSH:', utils.ShellQuoteArgs(args)
@@
-187,7
+197,6
@@
def GetNodeInstances(node, secondaries=False):
"""
master = qa_config.GetMasterNode()
"""
master = qa_config.GetMasterNode()
-
node_name = ResolveNodeName(node)
# Get list of all instances
node_name = ResolveNodeName(node)
# Get list of all instances