An edge case was detected and fixed: we can't guarantee that the cloud
image used will have an updated apt cache, so run `apt-get update`
before attempting to install the iptables-persistent package.
Second, additional debug output was added to trace an error that's only
been reproduced in the rc1 LCM image published to hub.docker.com.
Building the image locally have been unable to reproduce the error.
Change-Id: I333bedab8d754102eb13b9da06ee278b6cf0d6ad
Signed-off-by: Adam Israel <adam.israel@canonical.com>
IPTABLES_SCRIPT = """#!/bin/bash
set -e
IPTABLES_SCRIPT = """#!/bin/bash
set -e
+DEBIAN_FRONTEND=noninteractive apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -yqq iptables-persistent
iptables -t nat -A OUTPUT -p tcp -d {} -j DNAT --to-destination {}
netfilter-persistent save
DEBIAN_FRONTEND=noninteractive apt-get install -yqq iptables-persistent
iptables -t nat -A OUTPUT -p tcp -d {} -j DNAT --to-destination {}
netfilter-persistent save
if self._init_ubuntu_user():
try:
if self._init_ubuntu_user():
try:
+ step = "get ssh client"
ssh = self._get_ssh_client()
ssh = self._get_ssh_client()
+ step = "detect hardware and os"
hw = self._detect_hardware_and_os(ssh)
hw = self._detect_hardware_and_os(ssh)
params.series = hw['series']
params.series = hw['series']
params.instance_id = "manual:{}".format(self.host)
params.instance_id = "manual:{}".format(self.host)
params.nonce = "manual:{}:{}".format(
self.host,
str(uuid.uuid4()), # a nop for Juju w/manual machines
)
params.nonce = "manual:{}:{}".format(
self.host,
str(uuid.uuid4()), # a nop for Juju w/manual machines
)
+ step = "hw characteristics"
params.hardware_characteristics = {
'arch': hw['arch'],
'mem': int(hw['mem']),
'cpu-cores': int(hw['cpu-cores']),
}
params.hardware_characteristics = {
'arch': hw['arch'],
'mem': int(hw['mem']),
'cpu-cores': int(hw['cpu-cores']),
}
params.addresses = [{
'value': self.host,
'type': 'ipv4',
params.addresses = [{
'value': self.host,
'type': 'ipv4',
except paramiko.ssh_exception.AuthenticationException as e:
raise e
except paramiko.ssh_exception.AuthenticationException as e:
raise e
+ except Exception as e:
+ self.log.debug("Caught exception inside provision_machine step {}: {}".format(step, e))
+ raise e