mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge branch '2015.5' into '2015.8'
Conflicts: - doc/topics/highavailability/index.rst - salt/loader.py - salt/modules/service.py - salt/states/cmd.py - tests/unit/states/cmd_test.py
This commit is contained in:
commit
9531ea6ef5
4 changed files with 17 additions and 28 deletions
|
@ -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/
|
||||
|
|
|
@ -42,7 +42,8 @@ def __virtual__():
|
|||
'Linaro',
|
||||
'elementary OS',
|
||||
'McAfee OS Server',
|
||||
'Mint'
|
||||
'Mint',
|
||||
'Raspbian'
|
||||
))
|
||||
if __grains__.get('os', '') in disable:
|
||||
return False
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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})
|
||||
|
|
Loading…
Add table
Reference in a new issue