summaryrefslogtreecommitdiff
path: root/cloudinit/__init__.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2011-01-19 04:35:46 +0000
committerScott Moser <smoser@ubuntu.com>2011-01-19 04:35:46 +0000
commitb85106a10a78e4c15303ac3b9b16d03a3f2f9cab (patch)
tree97d3b765b5214c86e30144beee35fe10106282b2 /cloudinit/__init__.py
parent548f5b3f81799f3339e66444be58f7016fa8c0a2 (diff)
downloadvyos-cloud-init-b85106a10a78e4c15303ac3b9b16d03a3f2f9cab.tar.gz
vyos-cloud-init-b85106a10a78e4c15303ac3b9b16d03a3f2f9cab.zip
move user scripts ('#!' and runcmd) to be per-instance (LP: #675711)
Previously, if you ran an instance with either runcmd data or user-data scripts, it would run again after rebundle or create-image. This puts the files created by runcmd or user-data scripts into instance-id specific paths, and then runs them by that instance-id specific path. LP: #675711
Diffstat (limited to 'cloudinit/__init__.py')
-rw-r--r--cloudinit/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/cloudinit/__init__.py b/cloudinit/__init__.py
index fd20c7be..be366d4c 100644
--- a/cloudinit/__init__.py
+++ b/cloudinit/__init__.py
@@ -338,7 +338,8 @@ class CloudInit:
return
filename=filename.replace(os.sep,'_')
- util.write_file("%s/%s" % (user_scripts_dir,filename), payload, 0700)
+ util.write_file("%s/%s/%s" %
+ (user_scripts_dir,self.get_instance_id(),filename), payload, 0700)
def handle_upstart_job(self,data,ctype,filename,payload):
if ctype == "__end__" or ctype == "__begin__": return