summaryrefslogtreecommitdiff
path: root/cloudinit/CloudConfig/cc_runcmd.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/CloudConfig/cc_runcmd.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/CloudConfig/cc_runcmd.py')
-rw-r--r--cloudinit/CloudConfig/cc_runcmd.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/cloudinit/CloudConfig/cc_runcmd.py b/cloudinit/CloudConfig/cc_runcmd.py
index 97d21900..969f6394 100644
--- a/cloudinit/CloudConfig/cc_runcmd.py
+++ b/cloudinit/CloudConfig/cc_runcmd.py
@@ -21,7 +21,8 @@ import cloudinit.util as util
def handle(name,cfg,cloud,log,args):
if not cfg.has_key("runcmd"):
return
- outfile="%s/runcmd" % cloudinit.user_scripts_dir
+ outfile="%s/%s/runcmd" % \
+ (cloudinit.user_scripts_dir, cloud.get_instance_id())
content="#!/bin/sh\n"
escaped="%s%s%s%s" % ( "'", '\\', "'", "'" )