verification added for optional attributes
@@ -144,6 +144,15 @@ class ConfigurationManager(ConfigurationManagerSingleton):
# If Entry item exists in optional list, then update expected item entries
if entry_name in optional_item_entries:
+ if entry_name == 'readonly':
+ if entry_val.lower() not in ("true", "false"):
+ raise ValueError('Unrecognized value for entry_name {}'.format(entry_name))
+ else:
+ try:
+ _value = int(entry_val)
+ except Exception:
+ raise ValueError('Unrecognized value for entry_name {}'.format(entry_name))
+
d = {entry_name: entry_val}
expected_item_entries.update(d)
@@ -166,7 +175,7 @@ class ConfigurationManager(ConfigurationManagerSingleton):
if set_value_val_from_default_val:
if self._validate_type_value(get_entry_val("type"), get_entry_val("default")) is False:
- raise ValueError('Unrecognized value name for item_name {}'.format(item_name))
+ raise ValueError('Unrecognized value for item_name {}'.format(item_name))
item_val['default'] = self._clean(item_val['type'], item_val['default'])
item_val['value'] = item_val['default']
