Revision c38c44ad scripts/gnt-debug
b/scripts/gnt-debug | ||
---|---|---|
27 | 27 |
import simplejson |
28 | 28 |
import time |
29 | 29 |
|
30 |
from optparse import make_option |
|
31 |
|
|
32 | 30 |
from ganeti.cli import * |
33 | 31 |
from ganeti import cli |
34 | 32 |
from ganeti import opcodes |
... | ... | |
133 | 131 |
commands = { |
134 | 132 |
'delay': (Delay, [ArgUnknown(min=1, max=1)], |
135 | 133 |
[DEBUG_OPT, |
136 |
make_option("--no-master", dest="on_master", default=True,
|
|
137 |
action="store_false",
|
|
138 |
help="Do not sleep in the master code"),
|
|
139 |
make_option("-n", dest="on_nodes", default=[],
|
|
140 |
action="append",
|
|
141 |
help="Select nodes to sleep on"),
|
|
134 |
cli_option("--no-master", dest="on_master", default=True,
|
|
135 |
action="store_false", |
|
136 |
help="Do not sleep in the master code"), |
|
137 |
cli_option("-n", dest="on_nodes", default=[],
|
|
138 |
action="append", |
|
139 |
help="Select nodes to sleep on"), |
|
142 | 140 |
], |
143 | 141 |
"[opts...] <duration>", "Executes a TestDelay OpCode"), |
144 | 142 |
'submit-job': (GenericOpCodes, [ArgFile(min=1)], [DEBUG_OPT], |
... | ... | |
146 | 144 |
" containing a list of serialized opcodes"), |
147 | 145 |
'allocator': (TestAllocator, [ArgInstance(min=1, max=1)], |
148 | 146 |
[DEBUG_OPT, |
149 |
make_option("--dir", dest="direction",
|
|
150 |
default="in", choices=["in", "out"],
|
|
151 |
help="Show allocator input (in) or allocator"
|
|
152 |
" results (out)"),
|
|
153 |
make_option("--algorithm", dest="allocator",
|
|
154 |
default=None,
|
|
155 |
help="Allocator algorithm name"),
|
|
156 |
make_option("-m", "--mode", default="relocate",
|
|
157 |
choices=["relocate", "allocate"],
|
|
158 |
help="Request mode, either allocate or"
|
|
159 |
" relocate"),
|
|
147 |
cli_option("--dir", dest="direction",
|
|
148 |
default="in", choices=["in", "out"], |
|
149 |
help="Show allocator input (in) or allocator" |
|
150 |
" results (out)"), |
|
151 |
cli_option("--algorithm", dest="allocator",
|
|
152 |
default=None, |
|
153 |
help="Allocator algorithm name"), |
|
154 |
cli_option("-m", "--mode", default="relocate",
|
|
155 |
choices=["relocate", "allocate"], |
|
156 |
help="Request mode, either allocate or" |
|
157 |
" relocate"), |
|
160 | 158 |
cli_option("--mem", default=128, type="unit", |
161 | 159 |
help="Memory size for the instance (MiB)"), |
162 |
make_option("--disks", default="4096,4096",
|
|
163 |
help="Comma separated list of disk sizes (MiB)"),
|
|
164 |
make_option("-t", "--disk-template", default="drbd",
|
|
165 |
help="Select the disk template"),
|
|
166 |
make_option("--nics", default="00:11:22:33:44:55",
|
|
167 |
help="Comma separated list of nics, each nic"
|
|
168 |
" definition is of form mac/ip/bridge, if"
|
|
169 |
" missing values are replace by None"),
|
|
170 |
make_option("-o", "--os-type", default=None,
|
|
171 |
help="Select os for the instance"),
|
|
172 |
make_option("-p", "--vcpus", default=1, type="int",
|
|
173 |
help="Select number of VCPUs for the instance"),
|
|
174 |
make_option("--tags", default=None,
|
|
175 |
help="Comma separated list of tags"),
|
|
160 |
cli_option("--disks", default="4096,4096",
|
|
161 |
help="Comma separated list of disk sizes (MiB)"), |
|
162 |
cli_option("-t", "--disk-template", default="drbd",
|
|
163 |
help="Select the disk template"), |
|
164 |
cli_option("--nics", default="00:11:22:33:44:55",
|
|
165 |
help="Comma separated list of nics, each nic" |
|
166 |
" definition is of form mac/ip/bridge, if" |
|
167 |
" missing values are replace by None"), |
|
168 |
cli_option("-o", "--os-type", default=None,
|
|
169 |
help="Select os for the instance"), |
|
170 |
cli_option("-p", "--vcpus", default=1, type="int",
|
|
171 |
help="Select number of VCPUs for the instance"), |
|
172 |
cli_option("--tags", default=None,
|
|
173 |
help="Comma separated list of tags"), |
|
176 | 174 |
], |
177 | 175 |
"{opts...} <instance>", "Executes a TestAllocator OpCode"), |
178 | 176 |
} |
Also available in: Unified diff