diff options
author | Cole Robinson <crobinso@redhat.com> | 2022-03-01 14:27:31 -0500 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2022-03-01 14:29:46 -0500 |
commit | 78e24fc986a3f43b2a26f678b5b63d80e1a578ed (patch) | |
tree | 405a3cd7ba9aafa66eaf105d61f99a39d10d1a36 /virtinst | |
parent | 767f856017a312cd87b1b801438a91555eab914b (diff) | |
download | virt-manager-78e24fc986a3f43b2a26f678b5b63d80e1a578ed.tar.gz |
cloudinit: Fix disabling cloud-init on first boot
`sudo` throws errors and is not even required to write the `disable`
file. Also add a message to the file that it was created by us
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Diffstat (limited to 'virtinst')
-rw-r--r-- | virtinst/install/cloudinit.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/virtinst/install/cloudinit.py b/virtinst/install/cloudinit.py index 33c1df74..a5a3821f 100644 --- a/virtinst/install/cloudinit.py +++ b/virtinst/install/cloudinit.py @@ -95,7 +95,8 @@ def _create_userdata_content(cloudinit_data): if cloudinit_data.disable: content += "runcmd:\n" - content += "- [ sudo, touch, /etc/cloud/cloud-init.disabled ]\n" + content += ('- echo "Disabled by virt-install" > ' + "/etc/cloud/cloud-init.disabled\n") clean_content = re.sub(r"root:(.*)", 'root:[SCRUBBLED]', content) if "VIRTINST_TEST_SUITE_PRINT_CLOUDINIT" in os.environ: |