You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This appears to be a result of the /bin/sh in OS X having been configured with --enable-xpg-echo-default, so unless you disable xpg_echo, echo interprets escape sequences and does not support any options.
The text was updated successfully, but these errors were encountered:
Probably just acceptable to make the following change:
diff --git a/test/units/TestModuleUtilsBasic.py b/test/units/TestModuleUtilsBasic.py
index 3d85b61..d1ee95a 100644
--- a/test/units/TestModuleUtilsBasic.py+++ b/test/units/TestModuleUtilsBasic.py@@ -95,9 +95,9 @@ class TestModuleUtilsBasic(unittest.TestCase):
# test run_command with a command pipe (with both use_unsafe_shell=True|False)
def test_run_command_string_unsafe_with_pipe(self):
- (rc, out, err) = self.module.run_command('echo -n "foo bar" | cat', use_unsafe_shell=True)+ (rc, out, err) = self.module.run_command('echo "foo bar" | cat', use_unsafe_shell=True)
self.assertEqual(rc, 0)
- self.assertEqual(out, 'foo bar')+ self.assertEqual(out, 'foo bar\n')
# test run_command with a shell redirect in (with both use_unsafe_shell=True|False)
def test_run_command_string_unsafe_with_redirect_in(self):
Since this test wasn't meant to test echo -n functionality, I think the above is an ok solution. Perhaps we can create another test and see if it possible to fix the echo -n on a bash shell that has xpg_echo enabled.
Issue Type:
Bug Report
Ansible Version:
ansible 1.6 (devel f96568a) last updated 2014/03/17 07:40:34 (GMT -500)
Environment:
Control: Mac OS, virtualenv, python 2.7.5
Target: N/A
Summary:
Steps To Reproduce:
Expected Results:
Tests Pass
Actual Results:
test_run_command_string_unsafe_with_pipe is failing, and it appears to be a difference in how /bin/sh works on Mac with respect to echo.
A simple test of the following shows the behavior:
Whereas specifying executable=/bin/bash gives what we expect:
This appears to be a result of the /bin/sh in OS X having been configured with --enable-xpg-echo-default, so unless you disable xpg_echo, echo interprets escape sequences and does not support any options.
The text was updated successfully, but these errors were encountered: