summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cloudinit/CloudConfig/cc_bootcmd.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/cloudinit/CloudConfig/cc_bootcmd.py b/cloudinit/CloudConfig/cc_bootcmd.py
index 11e9938c..5a9e4356 100644
--- a/cloudinit/CloudConfig/cc_bootcmd.py
+++ b/cloudinit/CloudConfig/cc_bootcmd.py
@@ -35,7 +35,9 @@ def handle(name,cfg,cloud,log,args):
raise
try:
- subprocess.check_call(['/bin/sh'], stdin=tmpf)
+ env=os.environ.copy()
+ env['INSTANCE_ID']=cloud.get_instance_id()
+ subprocess.check_call(['/bin/sh'], env=env, stdin=tmpf)
tmpf.close()
except:
log.warn("failed to run commands from bootcmd")