Revision 12378fe3
b/lib/client/gnt_cluster.py | ||
---|---|---|
463 | 463 |
_PrintGroupedParams(result["nicparams"], roman=opts.roman_integers) |
464 | 464 |
|
465 | 465 |
ToStdout("Instance policy - limits for instances:") |
466 |
for key in constants.IPOLICY_PARAMETERS:
|
|
466 |
for key in constants.IPOLICY_ISPECS:
|
|
467 | 467 |
ToStdout(" - %s", key) |
468 | 468 |
_PrintGroupedParams(result["ipolicy"][key], roman=opts.roman_integers) |
469 | 469 |
ToStdout(" - enabled disk templates: %s", |
b/lib/cmdlib.py | ||
---|---|---|
734 | 734 |
if key not in constants.IPOLICY_ALL_KEYS: |
735 | 735 |
raise errors.OpPrereqError("Invalid key in new ipolicy: %s" % key, |
736 | 736 |
errors.ECODE_INVAL) |
737 |
if key in constants.IPOLICY_PARAMETERS:
|
|
737 |
if key in constants.IPOLICY_ISPECS:
|
|
738 | 738 |
utils.ForceDictType(value, constants.ISPECS_PARAMETER_TYPES) |
739 | 739 |
ipolicy[key] = _GetUpdatedParams(old_ipolicy.get(key, {}), value, |
740 | 740 |
use_none=use_none, |
b/lib/config.py | ||
---|---|---|
1 | 1 |
# |
2 | 2 |
# |
3 | 3 |
|
4 |
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Google Inc. |
|
4 |
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Google Inc.
|
|
5 | 5 |
# |
6 | 6 |
# This program is free software; you can redistribute it and/or modify |
7 | 7 |
# it under the terms of the GNU General Public License as published by |
... | ... | |
434 | 434 |
|
435 | 435 |
def _helper_ispecs(owner, params): |
436 | 436 |
for key, value in params.items(): |
437 |
if key in constants.IPOLICY_PARAMETERS:
|
|
437 |
if key in constants.IPOLICY_ISPECS:
|
|
438 | 438 |
fullkey = "ipolicy/" + key |
439 | 439 |
_helper(owner, fullkey, value, constants.ISPECS_PARAMETER_TYPES) |
440 | 440 |
else: |
b/lib/constants.py | ||
---|---|---|
951 | 951 |
ISPECS_STD = "std" |
952 | 952 |
IPOLICY_DTS = "disk_templates" |
953 | 953 |
|
954 |
IPOLICY_PARAMETERS = frozenset([
|
|
954 |
IPOLICY_ISPECS = frozenset([
|
|
955 | 955 |
ISPECS_MIN, |
956 | 956 |
ISPECS_MAX, |
957 | 957 |
ISPECS_STD, |
958 | 958 |
]) |
959 |
IPOLICY_ALL_KEYS = IPOLICY_PARAMETERS.union([IPOLICY_DTS])
|
|
959 |
IPOLICY_ALL_KEYS = IPOLICY_ISPECS.union([IPOLICY_DTS])
|
|
960 | 960 |
|
961 | 961 |
# Node parameter names |
962 | 962 |
ND_OOB_PROGRAM = "oob_program" |
b/lib/objects.py | ||
---|---|---|
98 | 98 |
""" |
99 | 99 |
assert frozenset(default_ipolicy.keys()) == constants.IPOLICY_ALL_KEYS |
100 | 100 |
ret_dict = {} |
101 |
for key in constants.IPOLICY_PARAMETERS:
|
|
101 |
for key in constants.IPOLICY_ISPECS:
|
|
102 | 102 |
ret_dict[key] = FillDict(default_ipolicy[key], |
103 | 103 |
custom_ipolicy.get(key, {}), |
104 | 104 |
skip_keys=skip_keys) |
Also available in: Unified diff