From 27032a10e8c9234ee4444be206da7b568bfa872a Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Wed, 19 Jan 2011 20:27:37 +0000 Subject: 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 --- cloud-init.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3