Revision 82ce55fa
b/qa/rapi-workload.py | ||
---|---|---|
27 | 27 |
# due to invalid name |
28 | 28 |
|
29 | 29 |
import inspect |
30 |
import optparse |
|
30 | 31 |
import sys |
31 | 32 |
import types |
32 | 33 |
|
... | ... | |
1053 | 1054 |
qa_config.ReleaseManyNodes(nodes) |
1054 | 1055 |
|
1055 | 1056 |
|
1056 |
def Usage(): |
|
1057 |
sys.stderr.write("Usage:\n\trapi-workload.py qa-config-file") |
|
1058 |
|
|
1059 |
|
|
1060 | 1057 |
def Main(): |
1061 |
if len(sys.argv) < 2: |
|
1062 |
Usage() |
|
1063 |
|
|
1064 |
qa_config.Load(sys.argv[1]) |
|
1058 |
parser = optparse.OptionParser(usage="%prog [options] <config-file>") |
|
1059 |
parser.add_option("--yes-do-it", dest="yes_do_it", |
|
1060 |
action="store_true", |
|
1061 |
help="Really execute the tests") |
|
1062 |
parser.add_option("--show-invocations", dest="show_invocations", |
|
1063 |
action="store_true", |
|
1064 |
help="Show which client methods have and have not been " |
|
1065 |
"called") |
|
1066 |
(opts, args) = parser.parse_args() |
|
1067 |
|
|
1068 |
if not opts.yes_do_it: |
|
1069 |
print ("Executing this script irreversibly destroys any Ganeti\n" |
|
1070 |
"configuration on all nodes involved. If you really want\n" |
|
1071 |
"to start testing, supply the --yes-do-it option.") |
|
1072 |
sys.exit(1) |
|
1073 |
|
|
1074 |
qa_config.Load(args[0]) |
|
1065 | 1075 |
|
1066 | 1076 |
# Only the master will be present after a fresh QA cluster setup, so we have |
1067 | 1077 |
# to invoke this to get all the other nodes. |
... | ... | |
1076 | 1086 |
# The method invoked has the naming of the protected method, and pylint does |
1077 | 1087 |
# not like this. Disabling the warning is healthier than explicitly adding and |
1078 | 1088 |
# maintaining an exception for this method in the wrapper. |
1079 |
# pylint: disable=W0212 |
|
1080 |
client._OutputMethodInvocationDetails() |
|
1081 |
# pylint: enable=W0212 |
|
1089 |
if opts.show_invocations: |
|
1090 |
# pylint: disable=W0212 |
|
1091 |
client._OutputMethodInvocationDetails() |
|
1092 |
# pylint: enable=W0212 |
|
1082 | 1093 |
|
1083 | 1094 |
if __name__ == "__main__": |
1084 | 1095 |
Main() |
Also available in: Unified diff