From 49e550fb9e4c1ba1562cb3a7f4a493e857ba3088 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Thu, 5 Mar 2020 15:35:57 +0100 Subject: [PATCH] Fix autoinstall-extracting runcmd in the case no user-data is passed. --- debian/changelog | 6 ++++++ .../includes.binary/overlay/etc/cloud/cloud.cfg | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 5bef7141..4c9c5530 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +livecd-rootfs (2.649) UNRELEASED; urgency=medium + + * Fix autoinstall-extracting runcmd in the case no user-data is passed. + + -- Michael Hudson-Doyle Thu, 05 Mar 2020 15:35:17 +0100 + livecd-rootfs (2.648) focal; urgency=medium * Enable cloud-init in live server installer live session on all diff --git a/live-build/ubuntu-server/includes.binary/overlay/etc/cloud/cloud.cfg b/live-build/ubuntu-server/includes.binary/overlay/etc/cloud/cloud.cfg index a738bf15..ae6ce8a7 100644 --- a/live-build/ubuntu-server/includes.binary/overlay/etc/cloud/cloud.cfg +++ b/live-build/ubuntu-server/includes.binary/overlay/etc/cloud/cloud.cfg @@ -126,6 +126,6 @@ runcmd: user_data = yaml.safe_load(subprocess.run([ "cloud-init", "query", "userdata"], check=True, stdout=subprocess.PIPE, encoding='utf-8').stdout) - if 'autoinstall' in user_data: + if user_data is not None and 'autoinstall' in user_data: with open("/autoinstall.yaml", "w") as fp: yaml.dump(user_data['autoinstall'], fp)