diff options
author | 2019-05-06 04:06:36 +0000 | |
---|---|---|
committer | 2019-05-06 04:06:36 +0000 | |
commit | 72584d1ed32f4936c49b80a1278d5af19c2a0dad (patch) | |
tree | 0469d57bafab5a6a872815e4f605bf0dd1af0300 /robotframework-onap/vcpeutils/csar_parser.py | |
parent | 1a18e91083fdd58ea528513fdf85db678deeb0c7 (diff) | |
parent | 158df8f73cb2988031cd408939681d3ade443b2f (diff) |
Merge "fix vcpeutils"
Diffstat (limited to 'robotframework-onap/vcpeutils/csar_parser.py')
-rwxr-xr-x | robotframework-onap/vcpeutils/csar_parser.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/robotframework-onap/vcpeutils/csar_parser.py b/robotframework-onap/vcpeutils/csar_parser.py index 7440310..2adcf63 100755 --- a/robotframework-onap/vcpeutils/csar_parser.py +++ b/robotframework-onap/vcpeutils/csar_parser.py @@ -12,8 +12,8 @@ class CsarParser: 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): """ @@ -198,7 +198,7 @@ class CsarParser: 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) @@ -212,19 +212,19 @@ class CsarParser: 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') |