Avoid Early Convert ret['comment'] to String

Fixes this exception:
An exception occurred in this state: Traceback (most recent call last):
  File "/var/tmp/.syops_b1274f_salt/py2/salt/state.py", line 1733, in call
    **cdata['kwargs'])
  File "/var/tmp/.syops_b1274f_salt/py2/salt/loader.py", line 1652, in wrapper
    return f(*args, **kwargs)
  File "/var/tmp/.syops_b1274f_salt/py2/salt/states/gpg.py", line 119, in present
    ret['comment'].append('Adding {0} to GPG keychain'.format(name))
AttributeError: 'str' object has no attribute 'append'
This commit is contained in:
Michael A. Smith 2016-11-02 15:41:52 -04:00 committed by rallytime
parent 8c0a83cbb5
commit 01addb6053

View file

@ -132,7 +132,7 @@ def present(name,
else:
ret['comment'].append('Invalid trust level {0}'.format(trust))
ret['comment'] = '\n'.join(ret['comment'])
ret['comment'] = '\n'.join(ret['comment'])
return ret
@ -188,5 +188,5 @@ def absent(name,
ret['comment'].append('Deleting {0} from GPG keychain'.format(name))
else:
ret['comment'].append('{0} not found in GPG keychain'.format(name))
ret['comment'] = '\n'.join(ret['comment'])
ret['comment'] = '\n'.join(ret['comment'])
return ret