Created
February 4, 2015 12:19
-
-
Save dizz/09828661811dedcff621 to your computer and use it in GitHub Desktop.
heat create with softconfig - fixed. this confirms the fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from heatclient import client | |
from sdk.mcn import util | |
if __name__ == '__main__': | |
tenant_name = 'admin' | |
token = '' | |
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 = False | |
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) # fooked up! | |
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) | |
res = deployer.deploy(template, token, username=tenant_name, password=token) | |
print res | |
heat_content.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment