summaryrefslogtreecommitdiff
path: root/cloud-init.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2011-01-19 20:27:37 +0000
committerScott Moser <smoser@ubuntu.com>2011-01-19 20:27:37 +0000
commit27032a10e8c9234ee4444be206da7b568bfa872a (patch)
tree1ea57ffefa6cea47baacde5994a80fcff4f3a08d /cloud-init.py
parentaa100d108395640a1769158062f4123f135759f8 (diff)
downloadvyos-cloud-init-27032a10e8c9234ee4444be206da7b568bfa872a.tar.gz
vyos-cloud-init-27032a10e8c9234ee4444be206da7b568bfa872a.zip
write the previous-hostname file to persistent cloud/data
This change just uses a different facility for coming up with the path. But, by design I'm chosing to put 'previous-hostname' in /var/lib/cloud/data/ rather than in /var/lib/cloud/instance/data/ The idea is that if the user: - started an instance - modified /etc/hostname - bundled instance (or create-image from it) - started new instance They would expect their modified /etc/hostname to persist. As such, the previous-hostname file should be cross-instance data. Bugs in this area include LP: #596993 and LP: #514492
Diffstat (limited to 'cloud-init.py')
-rwxr-xr-xcloud-init.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cloud-init.py b/cloud-init.py
index 32add699..bdfa9f01 100755
--- a/cloud-init.py
+++ b/cloud-init.py
@@ -146,7 +146,7 @@ def set_hostname(hostname, log):
log.error("failed to set_hostname")
def update_hostname(hostname, log):
- prev_file="%s/%s" % (cloudinit.datadir,"previous-hostname")
+ prev_file="%s/%s" % (cloudinit.get_cpath('datadir'),"previous-hostname")
etc_file = "/etc/hostname"
hostname_prev = None