self.logger = logging.getLogger(__name__)
self.svc_model = {}
self.net_models = [] # there could be multiple networks
- self.vnf_models = [] # this version only support a single VNF in the service template
- self.vfmodule_models = [] # this version only support a single VF module in the service template
+ self.vnf_models = [] # this version only support a single VNF in the service template
+ self.vfmodule_models = [] # this version only support a single VF module in the service template
def get_service_yaml_from_csar(self, csar_file):
"""
self.vnf_models = [] # this version only support a single VNF in the service template
self.vfmodule_models = [] # this version only support a single VF module in the service template
- svc_template = yaml.load(file(filename, 'r'))
+ svc_template = yaml.load(open(filename, 'r'), Loader=yaml.Loader)
self.get_service_model_info(svc_template)
self.get_vnf_and_network_model_info(svc_template)
self.get_vfmodule_model_info(svc_template)
def print_models(self):
print('---------Service Model----------')
- print((json.dumps(self.svc_model, indent=2, sort_keys=True)))
+ print(json.dumps(self.svc_model, indent=2, sort_keys=True))
print('---------Network Model(s)----------')
for model in self.net_models:
- print((json.dumps(model, indent=2, sort_keys=True)))
+ print(json.dumps(model, indent=2, sort_keys=True))
print('---------VNF Model(s)----------')
for model in self.vnf_models:
- print((json.dumps(model, indent=2, sort_keys=True)))
+ print(json.dumps(model, indent=2, sort_keys=True))
print('---------VF Module Model(s)----------')
for model in self.vfmodule_models:
- print((json.dumps(model, indent=2, sort_keys=True)))
+ print(json.dumps(model, indent=2, sort_keys=True))
def test(self):
self.parse_csar('csar/service-Vcpesvcinfra111601-csar.csar')