add INSTANCE_ID to environment of bootcmd scripts

This commit is contained in:
Scott Moser 2011-12-20 11:35:41 -05:00
parent 21ce2c796b
commit 794cdb0f61

View File

@ -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")