When scripts are doing an ssh or scp to the PROX instances, errors were
sometimes hidden. E.g. when we try to upload a config file to the PROX
instance that is already existing but owned by another user, we would
not see the error on the screen.
Note this will only happen if you build your own image. In case you use
the pre-canned PROX images, this should not cause issues.
Change-Id: I94176b737cd548c93afc71450a85910d7eca2b0c
Signed-off-by: Luc Provoost <luc.provoost@intel.com>
if attempts > 20:
RapidLog.exception("Failed to connect to instance after %d\
attempts:\n%s" % (attempts, ex))
if attempts > 20:
RapidLog.exception("Failed to connect to instance after %d\
attempts:\n%s" % (attempts, ex))
- raise Exception("Failed to connect to instance after %d \
- attempts:\n%s" % (attempts, ex))
time.sleep(2)
RapidLog.debug("Trying to connect to machine \
on %s, attempt: %d" % (self._ip, attempts))
time.sleep(2)
RapidLog.debug("Trying to connect to machine \
on %s, attempt: %d" % (self._ip, attempts))
if attempts > 20:
RapidLog.exception("Failed to connect to PROX on %s after %d \
attempts" % (self._ip, attempts))
if attempts > 20:
RapidLog.exception("Failed to connect to PROX on %s after %d \
attempts" % (self._ip, attempts))
- raise Exception("Failed to connect to PROX on %s after %d \
- attempts" % (self._ip, attempts))
time.sleep(2)
RapidLog.debug("Trying to connect to PROX (just launched) on %s, \
attempt: %d" % (self._ip, attempts))
time.sleep(2)
RapidLog.debug("Trying to connect to PROX (just launched) on %s, \
attempt: %d" % (self._ip, attempts))
try:
return subprocess.check_output(cmd, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as ex:
try:
return subprocess.check_output(cmd, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as ex:
- #if _connect and ex.returncode == 255:
- if _connect:
- raise RuntimeWarning(ex.output.strip())
- raise RuntimeError('ssh returned exit status %d:\n%s'
+ RapidLog.exception('ssh returned exit status %d:\n%s'
% (ex.returncode, ex.output.strip()))
def prox_sock(self, port=8474):
% (ex.returncode, ex.output.strip()))
def prox_sock(self, port=8474):
# Actually ignore output on success, but capture stderr on failure
subprocess.check_output(cmd, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as ex:
# Actually ignore output on success, but capture stderr on failure
subprocess.check_output(cmd, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as ex:
- raise RuntimeError('scp returned exit status %d:\n%s'
+ RapidLog.exception('scp returned exit status %d:\n%s'
% (ex.returncode, ex.output.strip()))
def scp_get(self, src, dst):
% (ex.returncode, ex.output.strip()))
def scp_get(self, src, dst):
# Actually ignore output on success, but capture stderr on failure
subprocess.check_output(cmd, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as ex:
# Actually ignore output on success, but capture stderr on failure
subprocess.check_output(cmd, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as ex:
- raise RuntimeError('scp returned exit status %d:\n%s'
+ RapidLog.exception('scp returned exit status %d:\n%s'
% (ex.returncode, ex.output.strip()))
def _build_ssh(self, command):
% (ex.returncode, ex.output.strip()))
def _build_ssh(self, command):