Merge remote-tracking branch 'upstream/2014.7' into merge-forward-2015.5

This commit is contained in:
Colton Myers 2015-05-14 10:13:40 -06:00
commit 06a3ebd9d1
6 changed files with 48 additions and 13 deletions

View File

@ -0,0 +1,13 @@
===========================
Salt 2014.7.6 Release Notes
===========================
:release: TBA
Version 2014.7.6 is a bugfix release for :doc:`2014.7.0
</topics/releases/2014.7.0>`.
Changes:
- salt.runners.cloud.action() has changed the `fun` keyword argument to `func`.
Please update any calls to this function in the cloud runner.

View File

@ -295,7 +295,11 @@ def append(key, val, convert=False, delimiter=':'):
return 'The key {0} is not a valid list'.format(key)
if val in grains:
return 'The val {0} was already in the list {1}'.format(val, key)
grains.append(val)
if isinstance(val, list):
for item in val:
grains.append(item)
else:
grains.append(val)
while delimiter in key:
key, rest = key.rsplit(delimiter, 1)

View File

@ -379,7 +379,8 @@ def status(name, sig=None):
'''
if _untracked_custom_unit_found(name) or _unit_file_changed(name):
systemctl_reload()
return not __salt__['cmd.retcode'](_systemctl_cmd('is-active', name))
return not __salt__['cmd.retcode'](_systemctl_cmd('is-active', name),
ignore_retcode=True)
def enable(name, **kwargs):

View File

@ -126,7 +126,7 @@ def destroy(instances):
def action(
fun=None,
func=None,
cloudmap=None,
instances=None,
provider=None,
@ -136,7 +136,7 @@ def action(
Execute a single action on the given map/provider/instance
'''
client = _get_client()
info = client.action(fun, cloudmap, instances, provider, instance, kwargs)
info = client.action(func, cloudmap, instances, provider, instance, kwargs)
return info

View File

@ -103,10 +103,14 @@ def list_present(name, value):
ret['result'] = False
ret['comment'] = 'Grain {0} is not a valid list'.format(name)
return ret
if value in grain:
ret['comment'] = 'Value {1} is already in grain {0}'.format(name, value)
return ret
if isinstance(value, list):
if set(value).issubset(set(__grains__.get(name))):
ret['comment'] = 'Value {1} is already in grain {0}'.format(name, value)
return ret
else:
if value in grain:
ret['comment'] = 'Value {1} is already in grain {0}'.format(name, value)
return ret
if __opts__['test']:
ret['result'] = None
ret['comment'] = 'Value {1} is set to be appended to grain {0}'.format(name, value)
@ -118,12 +122,17 @@ def list_present(name, value):
ret['comment'] = 'Grain {0} is set to be added'.format(name)
ret['changes'] = {'new': grain}
return ret
new_grains = __salt__['grains.append'](name, value)
if value not in __grains__.get(name):
ret['result'] = False
ret['comment'] = 'Failed append value {1} to grain {0}'.format(name, value)
return ret
if isinstance(value, list):
if not set(value).issubset(set(__grains__.get(name))):
ret['result'] = False
ret['comment'] = 'Failed append value {1} to grain {0}'.format(name, value)
return ret
else:
if value not in __grains__.get(name):
ret['result'] = False
ret['comment'] = 'Failed append value {1} to grain {0}'.format(name, value)
return ret
ret['comment'] = 'Append value {1} to grain {0}'.format(name, value)
ret['changes'] = {'new': new_grains}
return ret

View File

@ -567,6 +567,14 @@ def present(name,
' {1}'.format(name, expire)
ret['result'] = False
ret['changes']['expire'] = expire
elif salt.utils.is_windows():
if password and not empty_password:
if not __salt__['user.setpassword'](name, password):
ret['comment'] = 'User {0} created but failed to set' \
' password to' \
' {1}'.format(name, password)
ret['result'] = False
ret['changes']['passwd'] = password
else:
ret['comment'] = 'Failed to create new user {0}'.format(name)
ret['result'] = False