enabled initial support for password prompt on become

- moved check prompt/password functions to connection, make more senes there
- TODO: consider moving make_become to connection from connection_info
- removed executable param that was never overriden outside of connection info
This commit is contained in:
Brian Coca 2015-06-15 00:09:25 -04:00
parent bac35ae773
commit 580993fef7
5 changed files with 37 additions and 38 deletions

View file

@ -425,7 +425,7 @@ class ActionBase:
debug("done with _execute_module (%s, %s)" % (module_name, module_args))
return data
def _low_level_execute_command(self, cmd, tmp, executable=None, sudoable=True, in_data=None):
def _low_level_execute_command(self, cmd, tmp, sudoable=True, in_data=None):
'''
This is the function which executes the low level shell command, which
may be commands to create/remove directories for temporary files, or to
@ -438,17 +438,15 @@ class ActionBase:
debug("no command, exiting _low_level_execute_command()")
return dict(stdout='', stderr='')
if executable is None:
executable = C.DEFAULT_EXECUTABLE
prompt = None
success_key = None
if sudoable:
cmd, prompt, success_key = self._connection_info.make_become_cmd(cmd, executable)
#FIXME: disabled as this should happen in the connection plugin, verify before removing
#prompt = None
#success_key = None
#
#if sudoable:
# cmd, prompt, success_key = self._connection_info.make_become_cmd(cmd)
debug("executing the command %s through the connection" % cmd)
rc, stdin, stdout, stderr = self._connection.exec_command(cmd, tmp, executable=executable, in_data=in_data)
rc, stdin, stdout, stderr = self._connection.exec_command(cmd, tmp, in_data=in_data, sudoable=sudoable)
debug("command execution done")
if not isinstance(stdout, basestring):