summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2022-03-30 09:22:02 +0000
committerGerrit Code Review <review@openstack.org>2022-03-30 09:22:02 +0000
commit29a9f5ef3908b5c7e45dbd010446c335a00e9ed4 (patch)
treeb9d9535cf644fabd36e1bda4cc0d39b2c84e2be7
parent9ba92c219f2dd44c85978d414395e6152d2be409 (diff)
parent074e59151d386d4fb39a26942789c33061df108d (diff)
downloadpython-neutronclient-stable/wallaby.tar.gz
Merge "Use yaml.safe_load instead of yaml.load" into stable/wallabywallaby-em7.3.1stable/wallaby
-rw-r--r--neutronclient/tests/functional/core/test_cli_formatter.py2
-rw-r--r--neutronclient/tests/unit/test_cli20.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/neutronclient/tests/functional/core/test_cli_formatter.py b/neutronclient/tests/functional/core/test_cli_formatter.py
index cd133de..145ed6c 100644
--- a/neutronclient/tests/functional/core/test_cli_formatter.py
+++ b/neutronclient/tests/functional/core/test_cli_formatter.py
@@ -43,7 +43,7 @@ class TestCLIFormatter(base.ClientTestBase):
result = self._create_net('yaml', ['name', 'admin_state_up'])
self.assertDictEqual({'name': self.net_name,
'admin_state_up': True},
- yaml.load(result))
+ yaml.safe_load(result))
def test_net_create_with_value_formatter(self):
# NOTE(amotoki): In 'value' formatter, there is no guarantee
diff --git a/neutronclient/tests/unit/test_cli20.py b/neutronclient/tests/unit/test_cli20.py
index c2143e1..a067ee8 100644
--- a/neutronclient/tests/unit/test_cli20.py
+++ b/neutronclient/tests/unit/test_cli20.py
@@ -1159,7 +1159,7 @@ class CLITestV20OutputFormatter(CLITestV20Base):
def test_create_resource_yaml(self):
self._test_create_resource_with_formatter('yaml')
- data = yaml.load(self.fake_stdout.make_string())
+ data = yaml.safe_load(self.fake_stdout.make_string())
self.assertEqual('myname', data['name'])
self.assertEqual('myid', data['id'])
@@ -1184,7 +1184,7 @@ class CLITestV20OutputFormatter(CLITestV20Base):
def test_show_resource_yaml(self):
self._test_show_resource_with_formatter('yaml')
- data = yaml.load(''.join(self.fake_stdout.content))
+ data = yaml.safe_load(''.join(self.fake_stdout.content))
self.assertEqual('myname', data['name'])
self.assertEqual('myid', data['id'])
@@ -1211,5 +1211,5 @@ class CLITestV20OutputFormatter(CLITestV20Base):
def test_list_resources_yaml(self):
self._test_list_resources_with_formatter('yaml')
- data = yaml.load(''.join(self.fake_stdout.content))
+ data = yaml.safe_load(''.join(self.fake_stdout.content))
self.assertEqual(['myid1', 'myid2'], [d['id'] for d in data])