Merge pull request #7007 from tima/test-sudo-cmd-esc

Fixed escaping of " in test_make_sudo_cmd in TestUtils so that it passes as it should.
pull/7011/head
Michael DeHaan 11 years ago
commit 8d060685fa

@ -503,7 +503,7 @@ class TestUtils(unittest.TestCase):
self.assertTrue(isinstance(cmd, tuple))
self.assertEqual(len(cmd), 3)
self.assertTrue('-u root' in cmd[0])
self.assertTrue('-p "[sudo via ansible, key=' in cmd[0] and cmd[1].startswith('[sudo via ansible, key'))
self.assertTrue('-p \\"[sudo via ansible, key=' in cmd[0] and cmd[1].startswith('[sudo via ansible, key'))
self.assertTrue('echo SUDO-SUCCESS-' in cmd[0] and cmd[2].startswith('SUDO-SUCCESS-'))
self.assertTrue('sudo -k' in cmd[0])

Loading…
Cancel
Save