Revision f4ad2ef0
b/daemons/ganeti-rapi | ||
---|---|---|
110 | 110 |
method = req.request_method.upper() |
111 | 111 |
try: |
112 | 112 |
ctx.handler_fn = getattr(ctx.handler, method) |
113 |
except AttributeError, err:
|
|
113 |
except AttributeError: |
|
114 | 114 |
raise http.HttpBadRequest("Method %s is unsupported for path %s" % |
115 | 115 |
(method, req.request_path)) |
116 | 116 |
|
b/daemons/ganeti-watcher | ||
---|---|---|
470 | 470 |
""" |
471 | 471 |
global client # pylint: disable-msg=W0603 |
472 | 472 |
|
473 |
options, args = ParseOptions()
|
|
473 |
options, _ = ParseOptions()
|
|
474 | 474 |
|
475 | 475 |
utils.SetupLogging(constants.LOG_WATCHER, debug=options.debug, |
476 | 476 |
stderr_logging=options.debug) |
b/scripts/gnt-backup | ||
---|---|---|
81 | 81 |
if not isinstance(dlist, list): |
82 | 82 |
ToStderr("Cannot parse execution results") |
83 | 83 |
return 1 |
84 |
tot_dsk = len(dlist) |
|
85 | 84 |
# TODO: handle diskless instances |
86 | 85 |
if dlist.count(False) == 0: |
87 | 86 |
# all OK |
... | ... | |
119 | 118 |
@return: the desired exit code |
120 | 119 |
|
121 | 120 |
""" |
122 |
instance = args[0] |
|
123 | 121 |
op = opcodes.OpRemoveExport(instance_name=args[0]) |
124 | 122 |
|
125 | 123 |
SubmitOpCode(op) |
b/scripts/gnt-cluster | ||
---|---|---|
512 | 512 |
|
513 | 513 |
# a list of (name, dict) we can pass directly to dict() (or []) |
514 | 514 |
hvparams = dict(opts.hvparams) |
515 |
for hv, hv_params in hvparams.iteritems():
|
|
515 |
for hv_params in hvparams.values():
|
|
516 | 516 |
utils.ForceDictType(hv_params, constants.HVS_PARAMETER_TYPES) |
517 | 517 |
|
518 | 518 |
beparams = opts.beparams |
b/scripts/gnt-instance | ||
---|---|---|
756 | 756 |
@return: the desired exit code |
757 | 757 |
|
758 | 758 |
""" |
759 |
instance_name = args[0] |
|
760 | 759 |
new_2ndary = opts.dst_node |
761 | 760 |
iallocator = opts.iallocator |
762 | 761 |
if opts.disks is None: |
b/scripts/gnt-job | ||
---|---|---|
181 | 181 |
client = GetClient() |
182 | 182 |
|
183 | 183 |
for job_id in args: |
184 |
(success, msg) = client.CancelJob(job_id)
|
|
184 |
(_, msg) = client.CancelJob(job_id)
|
|
185 | 185 |
ToStdout(msg) |
186 | 186 |
|
187 | 187 |
# TODO: Different exit value if not all jobs were canceled? |
b/scripts/gnt-node | ||
---|---|---|
356 | 356 |
|
357 | 357 |
pinst = utils.NiceSort(pinst) |
358 | 358 |
|
359 |
retcode = 0 |
|
360 |
|
|
361 | 359 |
if not force and not AskUser("Migrate instance(s) %s?" % |
362 | 360 |
(",".join("'%s'" % name for name in pinst))): |
363 | 361 |
return 2 |
b/scripts/gnt-os | ||
---|---|---|
106 | 106 |
|
107 | 107 |
has_bad = False |
108 | 108 |
|
109 |
for os_name, os_valid, os_variants, node_data in result:
|
|
109 |
for os_name, _, os_variants, node_data in result:
|
|
110 | 110 |
nodes_valid = {} |
111 | 111 |
nodes_bad = {} |
112 | 112 |
nodes_hidden = {} |
b/tools/cfgshell | ||
---|---|---|
177 | 177 |
|
178 | 178 |
""" |
179 | 179 |
pointer = self.parents[-1] |
180 |
dirs, entries = self._get_entries(pointer)
|
|
180 |
dirs, _ = self._get_entries(pointer)
|
|
181 | 181 |
matches = [str(name) for name in dirs if name.startswith(text)] |
182 | 182 |
return matches |
183 | 183 |
|
... | ... | |
202 | 202 |
return False |
203 | 203 |
|
204 | 204 |
pointer = self.parents[-1] |
205 |
dirs, entries = self._get_entries(pointer)
|
|
205 |
dirs, _ = self._get_entries(pointer)
|
|
206 | 206 |
|
207 | 207 |
if line not in dirs: |
208 | 208 |
print "No such child" |
... | ... | |
232 | 232 |
|
233 | 233 |
""" |
234 | 234 |
pointer = self.parents[-1] |
235 |
dirs, entries = self._get_entries(pointer)
|
|
235 |
_, entries = self._get_entries(pointer)
|
|
236 | 236 |
matches = [name for name in entries if name.startswith(text)] |
237 | 237 |
return matches |
238 | 238 |
|
... | ... | |
244 | 244 |
|
245 | 245 |
""" |
246 | 246 |
pointer = self.parents[-1] |
247 |
dirs, entries = self._get_entries(pointer)
|
|
247 |
_, entries = self._get_entries(pointer)
|
|
248 | 248 |
if line not in entries: |
249 | 249 |
print "No such entry" |
250 | 250 |
return False |
... | ... | |
351 | 351 |
|
352 | 352 |
This is just a wrapper over BootStrap, to handle our own exceptions. |
353 | 353 |
""" |
354 |
options, args = ParseOptions()
|
|
354 |
_, args = ParseOptions()
|
|
355 | 355 |
if args: |
356 | 356 |
cfg_file = args[0] |
357 | 357 |
else: |
b/tools/lvmstrap | ||
---|---|---|
192 | 192 |
if os.getuid() != 0: |
193 | 193 |
raise PrereqError("This tool runs as root only. Really.") |
194 | 194 |
|
195 |
osname, nodename, release, version, arch = os.uname()
|
|
195 |
osname, _, release, _, _ = os.uname()
|
|
196 | 196 |
if osname != 'Linux': |
197 | 197 |
raise PrereqError("This tool only runs on Linux" |
198 | 198 |
" (detected OS: %s)." % osname) |
... | ... | |
271 | 271 |
""" |
272 | 272 |
|
273 | 273 |
path = "/dev/%s" % name |
274 |
for retries in range(40):
|
|
274 |
for _ in range(40):
|
|
275 | 275 |
if os.path.exists(path): |
276 | 276 |
break |
277 | 277 |
time.sleep(0.250) |
... | ... | |
426 | 426 |
mountlines = ReadFile("/proc/mounts").splitlines() |
427 | 427 |
mounts = {} |
428 | 428 |
for line in mountlines: |
429 |
device, mountpoint, fstype, rest = line.split(None, 3)
|
|
429 |
_, mountpoint, fstype, _ = line.split(None, 3)
|
|
430 | 430 |
# fs type blacklist |
431 | 431 |
if fstype in ["nfs", "nfs4", "autofs", "tmpfs", "proc", "sysfs"]: |
432 | 432 |
continue |
... | ... | |
542 | 542 |
boolean, the in-use status of the device |
543 | 543 |
""" |
544 | 544 |
|
545 |
for retries in range(3):
|
|
545 |
for _ in range(3):
|
|
546 | 546 |
result = ExecCommand("blockdev --rereadpt /dev/%s" % name) |
547 | 547 |
if not result.failed: |
548 | 548 |
break |
... | ... | |
672 | 672 |
" non-removable block devices).") |
673 | 673 |
sysd_free = [] |
674 | 674 |
sysd_used = [] |
675 |
for name, size, dev, part, used in sysdisks:
|
|
675 |
for name, _, _, _, used in sysdisks:
|
|
676 | 676 |
if used: |
677 | 677 |
sysd_used.append(name) |
678 | 678 |
else: |
... | ... | |
726 | 726 |
CreatePVOnDisk(disk) |
727 | 727 |
CreateVG(vgname, disklist) |
728 | 728 |
|
729 |
status, lv_count, size, free = CheckVGExists(vgname)
|
|
729 |
status, lv_count, size, _ = CheckVGExists(vgname)
|
|
730 | 730 |
if status: |
731 | 731 |
print "Done! %s: size %s GiB, disks: %s" % (vgname, size, |
732 | 732 |
",".join(disklist)) |
Also available in: Unified diff