Run `apt-get update` before attempting to install a package, for cloud
images without an apt cache.
Change-Id: Id67a347d90edbaa862a6d9c48ed1613f3fe2ad0d
Signed-off-by: Adam Israel <adam.israel@canonical.com>
IPTABLES_SCRIPT = """#!/bin/bash
set -e
+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
retry = 10
attempts = 0
delay = 15
+
while attempts <= retry:
try:
attempts += 1