From 46dde055c4616092672608fba98c1066923b7d44 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Fri, 21 Oct 2022 14:47:48 -0400 Subject: [PATCH] Move /dev umount to cleanup step --- api-daemon/provisioner/examples/script/3-debootstrap.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api-daemon/provisioner/examples/script/3-debootstrap.py b/api-daemon/provisioner/examples/script/3-debootstrap.py index b5613037..dae3087b 100644 --- a/api-daemon/provisioner/examples/script/3-debootstrap.py +++ b/api-daemon/provisioner/examples/script/3-debootstrap.py @@ -691,9 +691,6 @@ GRUB_DISABLE_LINUX_UUID=false # Debian cloud images are affected, so who knows. os.system("systemctl enable cloud-init.target") - # Unmount the bound devfs - os.system("umount {}/dev".format(temporary_directory)) - def cleanup(self): """ cleanup(): Perform any cleanup required due to prepare()/install() @@ -715,6 +712,9 @@ GRUB_DISABLE_LINUX_UUID=false # Set the tempdir we used in the prepare() and install() steps temp_dir = "/tmp/target" + # Unmount the bound devfs + os.system("umount {}/dev".format(temporary_directory)) + # Use this construct for reversing the list, as the normal reverse() messes with the list for volume in list(reversed(self.vm_data["volumes"])): dst_volume_name = f"{self.vm_name}_{volume['disk_id']}"