|
|
|
@ -5,8 +5,7 @@ from __future__ import absolute_import, print_function
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
import pipes
|
|
|
|
import pipes
|
|
|
|
import tempfile
|
|
|
|
import tempfile
|
|
|
|
|
|
|
|
import time
|
|
|
|
from time import sleep
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import lib.pytar
|
|
|
|
import lib.pytar
|
|
|
|
|
|
|
|
|
|
|
|
@ -50,13 +49,12 @@ class ManageWindowsCI(object):
|
|
|
|
env = ansible_environment(self.core_ci.args)
|
|
|
|
env = ansible_environment(self.core_ci.args)
|
|
|
|
cmd = ['ansible', '-m', 'win_ping', '-i', '%s,' % name, name, '-e', ' '.join(extra_vars)]
|
|
|
|
cmd = ['ansible', '-m', 'win_ping', '-i', '%s,' % name, name, '-e', ' '.join(extra_vars)]
|
|
|
|
|
|
|
|
|
|
|
|
for _ in range(1, 120):
|
|
|
|
for dummy in range(1, 120):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
intercept_command(self.core_ci.args, cmd, 'ping', env=env)
|
|
|
|
intercept_command(self.core_ci.args, cmd, 'ping', env=env)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
except SubprocessError:
|
|
|
|
except SubprocessError:
|
|
|
|
sleep(10)
|
|
|
|
time.sleep(10)
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
raise ApplicationError('Timeout waiting for %s/%s instance %s.' %
|
|
|
|
raise ApplicationError('Timeout waiting for %s/%s instance %s.' %
|
|
|
|
(self.core_ci.platform, self.core_ci.version, self.core_ci.instance_id))
|
|
|
|
(self.core_ci.platform, self.core_ci.version, self.core_ci.instance_id))
|
|
|
|
@ -92,13 +90,12 @@ class ManageNetworkCI(object):
|
|
|
|
name,
|
|
|
|
name,
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
for _ in range(1, 90):
|
|
|
|
for dummy in range(1, 90):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
intercept_command(self.core_ci.args, cmd, 'ping', env=env)
|
|
|
|
intercept_command(self.core_ci.args, cmd, 'ping', env=env)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
except SubprocessError:
|
|
|
|
except SubprocessError:
|
|
|
|
sleep(10)
|
|
|
|
time.sleep(10)
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
raise ApplicationError('Timeout waiting for %s/%s instance %s.' %
|
|
|
|
raise ApplicationError('Timeout waiting for %s/%s instance %s.' %
|
|
|
|
(self.core_ci.platform, self.core_ci.version, self.core_ci.instance_id))
|
|
|
|
(self.core_ci.platform, self.core_ci.version, self.core_ci.instance_id))
|
|
|
|
@ -144,13 +141,12 @@ class ManagePosixCI(object):
|
|
|
|
|
|
|
|
|
|
|
|
def wait(self):
|
|
|
|
def wait(self):
|
|
|
|
"""Wait for instance to respond to SSH."""
|
|
|
|
"""Wait for instance to respond to SSH."""
|
|
|
|
for _ in range(1, 90):
|
|
|
|
for dummy in range(1, 90):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
self.ssh('id')
|
|
|
|
self.ssh('id')
|
|
|
|
return
|
|
|
|
return
|
|
|
|
except SubprocessError:
|
|
|
|
except SubprocessError:
|
|
|
|
sleep(10)
|
|
|
|
time.sleep(10)
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
raise ApplicationError('Timeout waiting for %s/%s instance %s.' %
|
|
|
|
raise ApplicationError('Timeout waiting for %s/%s instance %s.' %
|
|
|
|
(self.core_ci.platform, self.core_ci.version, self.core_ci.instance_id))
|
|
|
|
(self.core_ci.platform, self.core_ci.version, self.core_ci.instance_id))
|
|
|
|
@ -209,6 +205,13 @@ class ManagePosixCI(object):
|
|
|
|
:type src: str
|
|
|
|
:type src: str
|
|
|
|
:type dst: str
|
|
|
|
:type dst: str
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
run_command(self.core_ci.args,
|
|
|
|
for dummy in range(1, 3):
|
|
|
|
['scp'] + self.ssh_args +
|
|
|
|
try:
|
|
|
|
['-P', str(self.core_ci.connection.port), '-q', '-r', src, dst])
|
|
|
|
run_command(self.core_ci.args,
|
|
|
|
|
|
|
|
['scp'] + self.ssh_args +
|
|
|
|
|
|
|
|
['-P', str(self.core_ci.connection.port), '-q', '-r', src, dst])
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
except SubprocessError:
|
|
|
|
|
|
|
|
time.sleep(10)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
raise ApplicationError('Failed transfer: %s -> %s' % (src, dst))
|
|
|
|
|