aboutsummaryrefslogtreecommitdiffstats
path: root/DominoServer.py
diff options
context:
space:
mode:
authorUlas Kozat <ulas.kozat@huawei.com>2016-11-17 22:41:32 +0000
committerGerrit Code Review <gerrit@opnfv.org>2016-11-17 22:41:32 +0000
commit825ff565d9ebebe06f915c977bf8782fcc9de8fa (patch)
tree0c84d2a0feb9c25391da8c234538ec73b2570d14 /DominoServer.py
parent5d434724bf89cffaa9b21a0b02fd0e5f74c0293f (diff)
parent0d1a7cbd73b3a42eb1dc32b598ed78080a7155bc (diff)
Merge "Replace toscaparser with native yaml to load published Tosca file into memory"
Diffstat (limited to 'DominoServer.py')
-rwxr-xr-xDominoServer.py9
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