mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
correct create list item value names
if the valuePrefix attribute does not exist on the list item, the value is the value name, other wise, the valuename a number with the valuePrefix prepended to it fixes #46627 needs to be backported to 2016.11 as well
This commit is contained in:
parent
395b7f8fdc
commit
2bee383e9d
1 changed files with 13 additions and 6 deletions
|
@ -3439,7 +3439,7 @@ def _processValueItem(element, reg_key, reg_valuename, policy, parent_element,
|
|||
element_valuenames = []
|
||||
element_values = this_element_value
|
||||
if this_element_value is not None:
|
||||
element_valuenames = list(range(1, len(this_element_value) + 1))
|
||||
element_valuenames = list([str(z) for z in range(1, len(this_element_value) + 1)])
|
||||
if 'additive' in element.attrib:
|
||||
if element.attrib['additive'].lower() == 'false':
|
||||
# a delete values will be added before all the other
|
||||
|
@ -3464,11 +3464,18 @@ def _processValueItem(element, reg_key, reg_valuename, policy, parent_element,
|
|||
if this_element_value is not None:
|
||||
element_valuenames = this_element_value.keys()
|
||||
element_values = this_element_value.values()
|
||||
|
||||
if 'valuePrefix' in element.attrib and element.attrib['valuePrefix'] != '':
|
||||
if this_element_value is not None:
|
||||
element_valuenames = ['{0}{1}'.format(element.attrib['valuePrefix'],
|
||||
k) for k in element_valuenames]
|
||||
if 'valuePrefix' in element.attrib:
|
||||
# if the valuePrefix attribute exists, the valuenames are <prefix><number>
|
||||
# most prefixes attributes are empty in the admx files, so the valuenames
|
||||
# end up being just numbers
|
||||
if element.attrib['valuePrefix'] != '':
|
||||
if this_element_value is not None:
|
||||
element_valuenames = ['{0}{1}'.format(element.attrib['valuePrefix'],
|
||||
k) for k in element_valuenames]
|
||||
else:
|
||||
# if there is no valuePrefix attribute, the valuename is the value
|
||||
if element_values is not None:
|
||||
element_valuenames = [str(z) for z in element_values]
|
||||
if not check_deleted:
|
||||
if this_element_value is not None:
|
||||
log.debug('_processValueItem has an explicit element_value of {0}'.format(this_element_value))
|
||||
|
|
Loading…
Add table
Reference in a new issue