From 0199867815b599994fae350a67263d91435adc29 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Thu, 25 Apr 2019 17:56:51 +0200 Subject: Remove python warnings (yaml.load) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It updates refstack_defcore and vmtp to conform with yaml [1]. [1] https://build.opnfv.org/ci/job/functest-opnfv-functest-smoke-latest-refstack_defcore-run/186/console Change-Id: I38e7a8d4c294c27f01c3e7385c4b716522a40334 Signed-off-by: Cédric Ollivier --- functest/opnfv_tests/openstack/refstack/refstack.py | 4 ++-- functest/opnfv_tests/openstack/vmtp/vmtp.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'functest/opnfv_tests/openstack') diff --git a/functest/opnfv_tests/openstack/refstack/refstack.py b/functest/opnfv_tests/openstack/refstack/refstack.py index c709e5626..814cb255b 100644 --- a/functest/opnfv_tests/openstack/refstack/refstack.py +++ b/functest/opnfv_tests/openstack/refstack/refstack.py @@ -37,7 +37,7 @@ class Refstack(tempest.TempestCommon): yaml_data, grp.group(1), grp.group(2)) except Exception: # pylint: disable=broad-except self.__logger.warning("Cannot parse %s", line) - return yaml.load(yaml_data) + return yaml.full_load(yaml_data) def _extract_tempest_data(self): olddir = os.getcwd() @@ -60,7 +60,7 @@ class Refstack(tempest.TempestCommon): yaml_data2, grp.group(1), grp.group(2)) except Exception: # pylint: disable=broad-except self.__logger.warning("Cannot parse %s. skipping it", line) - return yaml.load(yaml_data2) + return yaml.full_load(yaml_data2) def generate_test_list(self, **kwargs): self.backup_tempest_config(self.conf_file, '/etc') diff --git a/functest/opnfv_tests/openstack/vmtp/vmtp.py b/functest/opnfv_tests/openstack/vmtp/vmtp.py index 3462ec063..883f35dca 100644 --- a/functest/opnfv_tests/openstack/vmtp/vmtp.py +++ b/functest/opnfv_tests/openstack/vmtp/vmtp.py @@ -107,7 +107,7 @@ class Vmtp(singlevm.VmReady2): output = subprocess.check_output(cmd) self.__logger.info("%s\n%s", " ".join(cmd), output) with open(self.config, "w+") as conf: - vmtp_conf = yaml.load(output) + vmtp_conf = yaml.full_load(output) vmtp_conf["private_key_file"] = self.privkey_filename vmtp_conf["public_key_file"] = self.pubkey_filename vmtp_conf["image_name"] = str(self.image.name) -- cgit 1.2.3-korg