Revision 57dc299a lib/cmdlib.py
b/lib/cmdlib.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 |
... | ... | |
731 | 731 |
use_none = use_default = group_policy |
732 | 732 |
ipolicy = copy.deepcopy(old_ipolicy) |
733 | 733 |
for key, value in new_ipolicy.items(): |
734 |
if key not in constants.IPOLICY_ALL_KEYS: |
|
735 |
raise errors.OpPrereqError("Invalid key in new ipolicy: %s" % key, |
|
736 |
errors.ECODE_INVAL) |
|
734 | 737 |
if key in constants.IPOLICY_PARAMETERS: |
735 | 738 |
utils.ForceDictType(value, constants.ISPECS_PARAMETER_TYPES) |
736 | 739 |
ipolicy[key] = _GetUpdatedParams(old_ipolicy.get(key, {}), value, |
... | ... | |
747 | 750 |
" on the cluster'" % key, |
748 | 751 |
errors.ECODE_INVAL) |
749 | 752 |
else: |
750 |
logging.info("Setting %s to %s", key, value) |
|
751 | 753 |
ipolicy[key] = list(value) |
752 | 754 |
try: |
753 | 755 |
objects.InstancePolicy.CheckParameterSyntax(ipolicy) |
Also available in: Unified diff