summaryrefslogtreecommitdiff
path: root/debian/cloud-init.postinst
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2016-08-23 16:48:40 -0400
committerScott Moser <smoser@brickies.net>2016-08-23 16:48:40 -0400
commitd269e3c782f13795b00e72413d5be43e7173465f (patch)
treecda8f5af5dee654a94794a0be3637dcc99c178c7 /debian/cloud-init.postinst
parent24365490c58df8f0ef2246838c81ec604f0311ac (diff)
downloadvyos-cloud-init-d269e3c782f13795b00e72413d5be43e7173465f.tar.gz
vyos-cloud-init-d269e3c782f13795b00e72413d5be43e7173465f.zip
Import version 0.7.7~bzr1189-0ubuntu1
Imported using git-dsc-commit.
Diffstat (limited to 'debian/cloud-init.postinst')
-rw-r--r--debian/cloud-init.postinst13
1 files changed, 13 insertions, 0 deletions
diff --git a/debian/cloud-init.postinst b/debian/cloud-init.postinst
index cfcd4528..dcea5ad7 100644
--- a/debian/cloud-init.postinst
+++ b/debian/cloud-init.postinst
@@ -201,6 +201,17 @@ cleanup_lp1552999() {
"$edir/cloud-init-local.service" "$edir/cloud-init.service"
}
+disable_network_config_on_upgrade() {
+ local oldver="$1" last_without_net="0.7.7~bzr1182-0ubuntu1"
+ if ! -f /var/lib/cloud/instance/obj.pkl ; then
+ # this is a fresh system not one that has been booted.
+ return 0
+ fi
+ if dpkg --compare-versions "$oldver" le "$last_without_net"; then
+ echo "dpkg upgrade from $oldver" > /var/lib/cloud/data/upgraded-network
+ fi
+}
+
if [ "$1" = "configure" ]; then
# disable ureadahead (LP: #499520)
dpkg-divert --package cloud-init --rename --divert \
@@ -241,6 +252,8 @@ EOF
# fix issue where cloud-init misidentifies the location of grub
fix_1336855
+ # make upgrades disable network changes by cloud-init
+ disable_network_config_on_upgrade "$2"
fi
#DEBHELPER#