diff options
author | Lukasz Rajewski <lukasz.rajewski@t-mobile.pl> | 2024-01-28 19:45:44 +0100 |
---|---|---|
committer | Lukasz Rajewski <lukasz.rajewski@t-mobile.pl> | 2024-01-29 22:24:42 +0100 |
commit | a7edeebc90bdd335361a7b36f5f5d12a14375554 (patch) | |
tree | 0e48ee456ef26471271c5412f3205aafcda41857 /src/onaptests/steps/instantiate/vl_ala_carte.py | |
parent | 2479155376b6142e97163a7903632015fed50815 (diff) |
Enhanced validation of configuration of all tests
Issue-ID: TEST-402
Signed-off-by: Lukasz Rajewski <lukasz.rajewski@t-mobile.pl>
Change-Id: I2e4ef6365b44c33f4c0b3e72886a83f92c63e2f3
Diffstat (limited to 'src/onaptests/steps/instantiate/vl_ala_carte.py')
-rw-r--r-- | src/onaptests/steps/instantiate/vl_ala_carte.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/onaptests/steps/instantiate/vl_ala_carte.py b/src/onaptests/steps/instantiate/vl_ala_carte.py index 7c2f4d9..72dcb2f 100644 --- a/src/onaptests/steps/instantiate/vl_ala_carte.py +++ b/src/onaptests/steps/instantiate/vl_ala_carte.py @@ -48,7 +48,7 @@ class YamlTemplateVlAlaCarteInstantiateStep(YamlTemplateBaseStep): """ if self.is_root: if not self._yaml_template: - with open(settings.SERVICE_YAML_TEMPLATE, "r") as yaml_template: + with open(settings.SERVICE_YAML_TEMPLATE, "r", encoding="utf-8") as yaml_template: self._yaml_template: dict = load(yaml_template, SafeLoader) return self._yaml_template return self.parent.yaml_template @@ -89,7 +89,7 @@ class YamlTemplateVlAlaCarteInstantiateStep(YamlTemplateBaseStep): for net in self.yaml_template[self.service_name]["networks"]: if net["vl_name"] == network_name: if net['subnets'] is None: - print("No Subnet defined") + self._logger.warning("No Subnet defined") else: for subnet in net['subnets']: yield Subnet( @@ -128,9 +128,9 @@ class YamlTemplateVlAlaCarteInstantiateStep(YamlTemplateBaseStep): if net_instantiation.failed: self._logger.error("VL instantiation %s failed", net_instantiation.name) raise onap_test_exceptions.NetworkInstantiateException - except TimeoutError: + except TimeoutError as exc: self._logger.error("VL instantiation %s timed out", net_instantiation.name) - raise onap_test_exceptions.NetworkInstantiateException + raise onap_test_exceptions.NetworkInstantiateException from exc @YamlTemplateBaseStep.store_state(cleanup=True) def cleanup(self) -> None: @@ -148,7 +148,7 @@ class YamlTemplateVlAlaCarteInstantiateStep(YamlTemplateBaseStep): if net_deletion.failed: self._logger.error("VL deletion %s failed", net_instance.name) raise onap_test_exceptions.NetworkCleanupException - except TimeoutError: + except TimeoutError as exc: self._logger.error("VL deletion %s timed out", net_instance.name) - raise onap_test_exceptions.NetworkCleanupException + raise onap_test_exceptions.NetworkCleanupException from exc super().cleanup() |