diff options
author | Ulas Kozat <ulas.kozat@gmail.com> | 2016-11-17 10:57:56 -0800 |
---|---|---|
committer | Ulas Kozat <ulas.kozat@gmail.com> | 2016-11-17 14:39:00 -0800 |
commit | 0d1a7cbd73b3a42eb1dc32b598ed78080a7155bc (patch) | |
tree | ba1158782257d75f7bfcbbe9d787de37caaf7839 /DominoServer.py | |
parent | a442c7788064542fe14c2e2e5d802fe2e1b14512 (diff) |
Replace toscaparser with native yaml to load published Tosca file into memory
Change-Id: I2ab06c97d103f95d53db256675b6949fa2b7b308
Signed-off-by: Ulas Kozat <ulas.kozat@gmail.com>
Diffstat (limited to 'DominoServer.py')
-rwxr-xr-x | DominoServer.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/DominoServer.py b/DominoServer.py index 5c5fbd4..9530170 100755 --- a/DominoServer.py +++ b/DominoServer.py @@ -14,7 +14,7 @@ import sys, os, glob, random, errno import getopt, socket import logging, json -import sqlite3 +import sqlite3, yaml #sys.path.append('gen-py') #sys.path.insert(0, glob.glob('./lib/py/build/lib.*')[0]) sys.path.insert(0, glob.glob('./lib')[0]) @@ -257,7 +257,8 @@ class CommunicationHandler: # Load tosca object from file into memory try: - tosca = ToscaTemplate( TOSCADIR+TOSCA_DEFAULT_FNAME ) + #tosca = ToscaTemplate( TOSCADIR+TOSCA_DEFAULT_FNAME ) + tpl = yaml.load(file(TOSCADIR+TOSCA_DEFAULT_FNAME,'r')) except: logging.error('Tosca Parser error: %s', sys.exc_info()[0]) #tosca file could not be read @@ -269,7 +270,7 @@ class CommunicationHandler: return pub_r # Extract Labels - node_labels = label.extract_labels( tosca ) + node_labels = label.extract_labels( tpl ) logging.debug('Node Labels: %s', node_labels) # Map nodes in the template to resource domains @@ -281,7 +282,7 @@ class CommunicationHandler: logging.debug('Selected Sites: %s', node_site) # Create per-domain Tosca files - file_paths = partitioner.partition_tosca('./toscafiles/template',node_site,tosca.tpl) + file_paths = partitioner.partition_tosca('./toscafiles/template',node_site,tpl) logging.debug('Per domain file paths: %s', file_paths) # Create work-flow |