Commit 8d08d365 authored by Spiros Koulouzis's avatar Spiros Koulouzis

run test if example message exists

parent 7664bf21
......@@ -35,13 +35,7 @@ class TestDeployer(unittest.TestCase):
def test(self):
logger = logging.getLogger(__name__)
message_file_path = str(Path.home()) + '/Downloads/message_deploy_request.json'
# example_messages_path = "../../example_messages/"
# message_file_path = example_messages_path + '/message_deploy_request.json'
# if not os.path.exists(message_file_path):
# example_messages_path = "../example_messages/"
# message_file_path = example_messages_path + '/message_deploy_request.json'
if os.path.isfile(message_file_path):
with open(message_file_path, 'r') as stream:
parsed_json_message = json.load(stream)
......@@ -75,39 +69,6 @@ class TestDeployer(unittest.TestCase):
for node_pair in nodes_pairs:
deployService.deploy(node_pair)
# tmp_path = tempfile.mkdtemp()
# vms = tosca.get_vms(tosca_template_dict)
# inventory_path = ansible_service.write_inventory_file(tmp_path, vms)
# paths = ansible_service.write_playbooks_from_tosca_interface(tosca_interfaces, tmp_path)
#
# tokens = {}
# for playbook_path in paths:
# out, err = ansible_service.run(inventory_path, playbook_path)
# api_key, join_token, discovery_token_ca_cert_hash = ansible_service.parse_api_tokens(out.decode("utf-8"))
# if api_key:
# tokens['api_key'] = api_key
# if join_token:
# tokens['join_token'] = join_token
# if discovery_token_ca_cert_hash:
# tokens['discovery_token_ca_cert_hash'] = discovery_token_ca_cert_hash
#
# ansible_playbook_path = k8s_service.write_ansible_k8s_files(tosca_template_dict, tmp_path)
# out, err = ansible_service.run(inventory_path, ansible_playbook_path)
# dashboard_token = ansible_service.parse_dashboard_tokens(out.decode("utf-8"))
#
# tokens['dashboard_token'] = dashboard_token
#
# tosca_template_dict = tosca.add_tokens(tokens, tosca_template_dict)
#
# tosca_template_dict = tosca.add_dashboard_url(k8s_service.get_dashboard_url(vms), tosca_template_dict)
#
# response = {'toscaTemplate': tosca_template_dict}
# output_current_milli_time = int(round(time.time() * 1000))
# response["creationDate"] = output_current_milli_time
# logger.info("Returning Deployment")
# logger.info("Output message:" + json.dumps(response))
# print(json.dumps(response))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment