diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-10-08 15:53:21 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-10-08 15:53:21 +0000 |
commit | 6e36e9a1a29495f0c8b62fedddadcf8df78506d9 (patch) | |
tree | 609fc24eaf3d9ac9ed14d6520cccae147a7f3907 /morphlib/morph2.py | |
parent | c63bd810e953429b728adbadf60f10a08e6d4a06 (diff) | |
parent | f4aaea23b7d80084504832d6b967a50c2d501b9e (diff) | |
download | morph-6e36e9a1a29495f0c8b62fedddadcf8df78506d9.tar.gz |
Merge remote-tracking branch 'origin/danielfirth/RT189'
Changed the error (exception) to list all obsolete fields.
Diffstat (limited to 'morphlib/morph2.py')
-rw-r--r-- | morphlib/morph2.py | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/morphlib/morph2.py b/morphlib/morph2.py index 6975e699..a10dda8d 100644 --- a/morphlib/morph2.py +++ b/morphlib/morph2.py @@ -58,7 +58,6 @@ class Morphology(object): ('strata', []), ('description', ''), ('arch', None), - ('system-kind', None), ('configuration-extensions', []), ], 'cluster': [] @@ -169,10 +168,6 @@ class Morphology(object): self._set_default_value(self._dict, 'max-jobs', int(self['max-jobs'])) - if 'disk-size' in self: - self._set_default_value(self._dict, 'disk-size', - self._parse_size(self['disk-size'])) - for name, value in self.static_defaults[self['kind']]: if name not in self._dict: self._set_default_value(self._dict, name, value) @@ -207,17 +202,6 @@ class Morphology(object): 'deploy', dict()) - def _parse_size(self, size): - if isinstance(size, basestring): - size = size.lower() - if size.endswith('g'): - return int(size[:-1]) * 1024 ** 3 - elif size.endswith('m'): # pragma: no cover - return int(size[:-1]) * 1024 ** 2 - elif size.endswith('k'): # pragma: no cover - return int(size[:-1]) * 1024 - return int(size) # pragma: no cover - def lookup_child_by_name(self, name): '''Find child reference by its name. @@ -285,10 +269,7 @@ class Morphology(object): # Simple values. Use original value unless it has been changed from # the default in memmory. if live_dict[key] == live_dict.get('_orig_' + key, None): - if key in original_dict: - result = original_dict[key] - else: - result = None + result = original_dict.get(key, None) else: result = live_dict[key] return result |