mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
Updated to conform to proper ret values
This commit is contained in:
parent
d18b4be80b
commit
b98f5517de
@ -169,9 +169,9 @@ def list_absent(name, value):
|
||||
- dev
|
||||
'''
|
||||
ret = {'name': name,
|
||||
'changes': [],
|
||||
'changes': {},
|
||||
'result': True,
|
||||
'comment': []}
|
||||
'comment': ''}
|
||||
grain = __grains__.get(name)
|
||||
if grain:
|
||||
if isinstance(grain, list):
|
||||
@ -179,18 +179,18 @@ def list_absent(name, value):
|
||||
value = [value]
|
||||
for val in value:
|
||||
if val not in grain:
|
||||
ret['comment'].append('Value {1} is absent from ' \
|
||||
'grain {0}'.format(name, val))
|
||||
ret['comment'] += ('\nValue {1} is absent from '
|
||||
'grain {0}'.format(name, val))
|
||||
elif __opts__['test']:
|
||||
ret['result'] = None
|
||||
ret['comment'].append('Value {1} in grain {0} is set ' \
|
||||
'to be deleted'.format(name, val))
|
||||
ret['changes'].append({'deleted': val})
|
||||
ret['comment'] += ('\nValue {1} in grain {0} is set '
|
||||
'to be deleted'.format(name, val))
|
||||
ret['changes'][val] = 'deleted'
|
||||
elif val in grain:
|
||||
__salt__['grains.remove'](name, val)
|
||||
ret['comment'].append('Value {1} was deleted from ' \
|
||||
'grain {0}'.format(name, val))
|
||||
ret['changes'].append({'deleted': val})
|
||||
ret['comment'] += ('\nValue {1} was deleted from '
|
||||
'grain {0}'.format(name, val))
|
||||
ret['changes'][val] = 'deleted'
|
||||
return ret
|
||||
else:
|
||||
ret['result'] = False
|
||||
|
Loading…
Reference in New Issue
Block a user