X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=tests%2Ftest_partitioner.py;fp=tests%2Ftest_partitioner.py;h=75ec817f5720d9ab69e24edf2dd70f6d504b7501;hb=96af8475e3db496be22d2ede78081c1c67a51f96;hp=246f6ba000d54b66d0908950cf661e257c542e17;hpb=6aa5772f98296bf9bbb9bbed144cf52d48949119;p=domino.git diff --git a/tests/test_partitioner.py b/tests/test_partitioner.py index 246f6ba..75ec817 100755 --- a/tests/test_partitioner.py +++ b/tests/test_partitioner.py @@ -11,20 +11,21 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys, os, glob +import sys, os, glob, yaml sys.path.insert(0, glob.glob('./lib')[0]) -from toscaparser.tosca_template import ToscaTemplate +#from toscaparser.tosca_template import ToscaTemplate from mapper import * from partitioner import * def main(argv): try: - tosca = ToscaTemplate(argv[0]) + #tosca = ToscaTemplate(argv[0]) + tpl = yaml.load(file(argv[0],'r')) # Extract Labels - node_labels = label.extract_labels( tosca ) + node_labels = label.extract_labels( tpl ) print node_labels site_id = 0 subscribed_labels = {} @@ -40,10 +41,11 @@ def main(argv): node_site = label.select_site( site_map ) print node_site - file_paths = partitioner.partition_tosca("./tests/tmp/tosca",node_site,tosca.tpl) + file_paths = partitioner.partition_tosca("./tests/tmp/tosca",node_site,tpl) print file_paths except: print('Unexpected error: %s', sys.exc_info()[0]) if __name__ == "__main__": main(sys.argv[1:]) +