Skip to content

Instantly share code, notes, and snippets.

@dizz
Created February 2, 2015 12:29
Show Gist options
  • Save dizz/14df34f40ce0f07b1430 to your computer and use it in GitHub Desktop.
Save dizz/14df34f40ce0f07b1430 to your computer and use it in GitHub Desktop.
how i hate heat!
from heatclient import client
from sdk.mcn import util
if __name__ == '__main__':
tenant_name = 'admin'
token = '5bd4cefafa4c407f9b57767bfbbefbbf'
endpoint = 'http://bart.cloudcomplab.ch:35357/v2.0'
template_path = '/Users/andy/Desktop/soft-config.yaml'
# template_path = '/Users/andy/Source/MCN/Source/mcn-demo/d-ran-sm/bundle/data/test.yaml'
h_endpoint = 'http://160.85.4.14:8004/v1/ec505c22944748e0a6007fa2d203c083'
use_heat = True
with open(template_path) as heat_content:
template = heat_content.read()
if use_heat:
HEAT_VERSION = '1'
heat = client.Client(HEAT_VERSION, h_endpoint, token=token, username=tenant_name, password=token) # fugly!
res = heat.stacks.create(stack_name='sr-test1', template=template)
print res
else:
deployer = util.get_deployer(token, url_type='public', tenant_name=tenant_name, endpoint=endpoint, username=tenant_name)
res = deployer.deploy(template, token)
print res
heat_content.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment