|
|
@ -288,10 +288,11 @@ def copy_file_from_remote(module, local, local_file_directory, file_system='boot
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
child = pexpect.spawn('ssh ' + username + '@' + hostname + ' -p' + str(port))
|
|
|
|
child = pexpect.spawn('ssh ' + username + '@' + hostname + ' -p' + str(port))
|
|
|
|
# response could be unknown host addition or Password
|
|
|
|
# response could be unknown host addition or Password
|
|
|
|
index = child.expect(['yes', '(?i)Password'])
|
|
|
|
index = child.expect(['yes', '(?i)Password', '#'])
|
|
|
|
if index == 0:
|
|
|
|
if index == 0:
|
|
|
|
child.sendline('yes')
|
|
|
|
child.sendline('yes')
|
|
|
|
child.expect('(?i)Password')
|
|
|
|
child.expect('(?i)Password')
|
|
|
|
|
|
|
|
if index == 1:
|
|
|
|
child.sendline(password)
|
|
|
|
child.sendline(password)
|
|
|
|
child.expect('#')
|
|
|
|
child.expect('#')
|
|
|
|
ldir = '/'
|
|
|
|
ldir = '/'
|
|
|
|