Fix test failures

http://jenkins.saltstack.com/job/salt-rs-rhel5/1511/
This commit is contained in:
Erik Johnson 2014-02-01 16:51:48 -06:00
parent e254cbc764
commit 35c397d14b
2 changed files with 6 additions and 3 deletions

View File

@ -408,7 +408,10 @@ def _run(cmd,
try:
proc = salt.utils.timed_subprocess.TimedProc(cmd, **kwargs)
except (OSError, IOError) as exc:
raise CommandExecutionError('Unable to run command "{0}" with the context "{1}", reason: {2}'.format(cmd, kwargs, exc))
raise CommandExecutionError(
'Unable to run command {0!r} with the context {1!r}, reason: {2}'
.format(cmd, kwargs, exc)
)
try:
proc.wait(timeout)
@ -582,7 +585,7 @@ def run(cmd,
if 'child_pids' in jid_dict:
jid_dict['child_pids'].append(ret['pid'])
else:
jid_dict['child_pids'] = list(ret['pid'])
jid_dict['child_pids'] = [ret['pid']]
# Rewrite file
with salt.utils.fopen(jid_file, 'w+') as fn_:
fn_.write(serial.dumps(jid_dict))

View File

@ -42,7 +42,7 @@ else:
STUB_DISK_USAGE,
STUB_NETWORK_IO,
STUB_DISK_IO,
STUB_USER) = [None for val in range(7)]
STUB_USER) = [None for val in range(9)]
STUB_PID_LIST = [0, 1, 2, 3]
MOCK_PROC = mocked_proc = MagicMock('psutil.Process')