From cc915378bd187c8db63b6c65b2e9c7510b8578f6 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Tue, 20 Dec 2011 11:35:41 -0500 Subject: add INSTANCE_ID to environment of bootcmd scripts --- cloudinit/CloudConfig/cc_bootcmd.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cloudinit/CloudConfig/cc_bootcmd.py') 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") -- cgit v1.2.3