Install iptables-persistent if it doesn't exist 74/8974/4 v7.1.0rc3 v7.1.0rc4
authorDavid Garcia <david.garcia@canonical.com>
Tue, 26 May 2020 17:27:03 +0000 (19:27 +0200)
committerDavid Garcia <david.garcia@canonical.com>
Tue, 26 May 2020 17:53:17 +0000 (19:53 +0200)
Change-Id: I7535e7ff3b74236cd3c7e752244252481582d557
Signed-off-by: David Garcia <david.garcia@canonical.com>
n2vc/provisioner.py

index b170b2e..fbb16ca 100644 (file)
@@ -72,8 +72,8 @@ fi
 
 IPTABLES_SCRIPT = """#!/bin/bash
 set -e
-apt-get update
-DEBIAN_FRONTEND=noninteractive apt-get install -yqq iptables-persistent
+[ -v `which netfilter-persistent` ] && apt 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
 """