Im not sure if this is expected behaviour or not but when calling the v2
API for all smart_class parameters for a host, the response includes
multiple copies of the same parameter. For example…
calling /api/hosts/X/smart_class_parameters
<- SNIP ->
'results': [{'created_at': '2015-01-28T10:34:16Z',
'default_value': 'environment',
'description': None,
'id': 9,
'override': False,
'override_value_order': 'fqdn\nhostgroup\nos\ndomain',
'override_values_count': 0,
'parameter': 'autohostsscope',
'parameter_type': 'string',
'required': False,
'updated_at': '2015-01-28T10:34:16Z',
'validator_rule': None,
'validator_type': None},
{'created_at': '2015-01-28T10:34:17Z',
'default_value': 'environment',
'description': 'mydesc',
'id': 25,
'override': True,
'override_value_order':
'fqdn\nhostgroup\noperatingsystemrelease\nenvironment\nall_environments\ndefault_parameters_environment',
'override_values_count': 2,
'parameter': 'autohostsscope',
'parameter_type': 'string',
'required': False,
'updated_at': '2015-02-03T13:17:48Z',
'validator_rule': None,
'validator_type': None},
<- SNIP ->
You can see there are 2 instances of the parameter named 'autohostsscope',
with different override orders and different timestamps.
If I make this call
/api/environments/production/puppetclasses/MYCLASSID/smart_class_parameters
I get just one version of the override (the one with the later timestamp).
Obviously the foreman GUI shows the same.
Is the /api/hosts/X/smart_class_parameters API deliberately showing old
versions of a smart class parameter or is there a bug somewhere?
Thanks
Jeff