cup.shell package¶
Submodules¶
cup.shell.expect module¶
description: | Guannan just made a wraper out of pexpect. The original copyright belongs to the author of pexpect module. See it at http://pexpect.sourceforge.net/pexpect.html |
---|
-
cup.shell.expect.
go
(hostname, username, passwd, command='', timeout=800, b_print_stdout=True)[source]¶ deprecated, recommand using go_ex or go_with_scp
-
cup.shell.expect.
go_ex
(hostname, username, passwd, command='', timeout=800, b_print_stdout=True)[source]¶ Run [command] on remote [hostname] and return result. If you have a lot of escape sign in the command, recommand using go_with_scp
Parameters: timeout – execution timeout, by default 800 seconds Returns: return a dict with keys (‘exitstatus’ ‘remote_exitstatus’ ‘result’)
-
cup.shell.expect.
checkssh
(hostname, username, passwd)[source]¶ check if we can ssh to hostname. Return True if succeed, False otherwise.
-
cup.shell.expect.
go_with_scp
(hostname, username, passwd, command='', host_tmp='/tmp/', remote_tmp='/tmp/', timeout=800, b_print_stdout=True)[source]¶ Recommand using this function to remotely execute cmds.
go_witch_scp will write a temp script file and scp to hostname:[host_tmp]. Then execute it and get the result back.
Parameters: - host_tmp – temp folder for keeping the temporary script file (contains the cmd)
- remote_tmp – remote temp folder for keeping the temporary script file
- timeout – timeout
Returns: a dict with keys (‘exitstatus’ ‘remote_exitstatus’ ‘result’)
cup.shell.oper module¶
description: | shell operations related module |
---|
Module contents¶
description: | shell related module |
---|