mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
None will not be added to grains which generate [none]
This commit is contained in:
parent
c032506e6b
commit
a23108f795
@ -335,8 +335,9 @@ def append(key, val, convert=False, delimiter=DEFAULT_TARGET_DELIM):
|
||||
salt '*' grains.append key val
|
||||
'''
|
||||
grains = get(key, [], delimiter)
|
||||
if not isinstance(grains, list) and convert is True:
|
||||
grains = [grains]
|
||||
if convert:
|
||||
if not isinstance(grains, list):
|
||||
grains = [] if grains is None else [grains]
|
||||
if not isinstance(grains, list):
|
||||
return 'The key {0} is not a valid list'.format(key)
|
||||
if val in grains:
|
||||
|
Loading…
Reference in New Issue
Block a user