Revision 552328b8
b/lib/cli.py | ||
---|---|---|
1335 | 1335 |
constants.IP6_VERSION), |
1336 | 1336 |
help="Cluster-wide IP version for primary IP") |
1337 | 1337 |
|
1338 |
|
|
1339 |
def _PriorityOptionCb(option, _, value, parser): |
|
1340 |
"""Callback for processing C{--priority} option. |
|
1341 |
|
|
1342 |
""" |
|
1343 |
value = _PRIONAME_TO_VALUE[value] |
|
1344 |
|
|
1345 |
setattr(parser.values, option.dest, value) |
|
1346 |
|
|
1347 |
|
|
1338 | 1348 |
PRIORITY_OPT = cli_option("--priority", default=None, dest="priority", |
1339 | 1349 |
metavar="|".join(name for name, _ in _PRIORITY_NAMES), |
1340 | 1350 |
choices=_PRIONAME_TO_VALUE.keys(), |
1351 |
action="callback", type="choice", |
|
1352 |
callback=_PriorityOptionCb, |
|
1341 | 1353 |
help="Priority for opcode processing") |
1342 | 1354 |
|
1343 | 1355 |
HID_OS_OPT = cli_option("--hidden", dest="hidden", |
... | ... | |
2097 | 2109 |
if hasattr(options, "dry_run"): |
2098 | 2110 |
op.dry_run = options.dry_run |
2099 | 2111 |
if getattr(options, "priority", None) is not None: |
2100 |
op.priority = _PRIONAME_TO_VALUE[options.priority]
|
|
2112 |
op.priority = options.priority
|
|
2101 | 2113 |
|
2102 | 2114 |
|
2103 | 2115 |
def GetClient(query=False): |
Also available in: Unified diff