Merge pull request #32427 from rallytime/merge-2015.8

[2015.8] Merge forward from 2015.5 to 2015.8
This commit is contained in:
Nicole Thomas 2016-04-08 09:39:13 -06:00
commit def911974c
4 changed files with 17 additions and 28 deletions

View file

@ -3,7 +3,7 @@ Getting Started With Proxmox
============================
Proxmox Virtual Environment is a complete server virtualization management solution,
based on KVM virtualization and OpenVZ containers.
based on LXC and full virtualization with KVM.
Further information can be found at:
http://www.proxmox.org/

View file

@ -42,7 +42,8 @@ def __virtual__():
'Linaro',
'elementary OS',
'McAfee OS Server',
'Mint'
'Mint',
'Raspbian'
))
if __grains__.get('os', '') in disable:
return False

View file

@ -787,13 +787,6 @@ def run(name,
'result': False,
'comment': ''}
if cwd and not os.path.isdir(cwd):
ret['comment'] = (
'Desired working directory "{0}" '
'is not available'
).format(cwd)
return ret
# Need the check for None here, if env is not provided then it falls back
# to None and it is assumed that the environment is not being overridden.
if env is not None and not isinstance(env, (list, dict)):
@ -824,6 +817,13 @@ def run(name,
ret['comment'] = 'Command "{0}" would have been executed'.format(name)
return _reinterpreted_state(ret) if stateful else ret
if cwd and not os.path.isdir(cwd):
ret['comment'] = (
'Desired working directory "{0}" '
'is not available'
).format(cwd)
return ret
# Wow, we passed the test, run this sucker!
try:
cmd_all = __salt__['cmd.run_all'](
@ -997,13 +997,6 @@ def script(name,
'result': False,
'comment': ''}
if cwd and not os.path.isdir(cwd):
ret['comment'] = (
'Desired working directory "{0}" '
'is not available'
).format(cwd)
return ret
# Need the check for None here, if env is not provided then it falls back
# to None and it is assumed that the environment is not being overridden.
if env is not None and not isinstance(env, (list, dict)):
@ -1058,6 +1051,13 @@ def script(name,
'executed'.format(name)
return _reinterpreted_state(ret) if stateful else ret
if cwd and not os.path.isdir(cwd):
ret['comment'] = (
'Desired working directory "{0}" '
'is not available'
).format(cwd)
return ret
# Wow, we passed the test, run this sucker!
try:
cmd_all = __salt__['cmd.script'](source, python_shell=True, **cmd_kwargs)

View file

@ -131,12 +131,6 @@ class CmdTestCase(TestCase):
'changes': {},
'comment': ''}
with patch.object(os.path, 'isdir', MagicMock(return_value=False)):
with patch.dict(cmd.__opts__, {'test': False}):
comt = ('Desired working directory "/tmp/salt" is not available')
ret.update({'comment': comt})
self.assertDictEqual(cmd.run(name, cwd='/tmp/salt'), ret)
with patch.dict(cmd.__opts__, {'test': False}):
comt = ("Invalidly-formatted 'env' parameter. See documentation.")
ret.update({'comment': comt})
@ -180,12 +174,6 @@ class CmdTestCase(TestCase):
'changes': {},
'comment': ''}
with patch.object(os.path, 'isdir', MagicMock(return_value=False)):
with patch.dict(cmd.__opts__, {'test': False}):
comt = ('Desired working directory "/tmp/salt" is not available')
ret.update({'comment': comt})
self.assertDictEqual(cmd.script(name, cwd='/tmp/salt'), ret)
with patch.dict(cmd.__opts__, {'test': False}):
comt = ("Invalidly-formatted 'env' parameter. See documentation.")
ret.update({'comment': comt})