diff --git a/tripleo_common/tests/utils/test_passwords.py b/tripleo_common/tests/utils/test_passwords.py index 326c87243..9432c6cb9 100644 --- a/tripleo_common/tests/utils/test_passwords.py +++ b/tripleo_common/tests/utils/test_passwords.py @@ -39,7 +39,7 @@ class TestPasswords(base.TestCase): def test_get_snmpd_readonly_user_password(self): with mock.patch(self.open_builtins, mock.mock_open(read_data="data")): - with mock.patch('yaml.load') as mock_yaml: + with mock.patch('yaml.safe_load') as mock_yaml: with mock.patch('os.path.exists') as mock_exists: mock_exists.return_value = True mock_yaml.return_value = { diff --git a/tripleo_common/utils/passwords.py b/tripleo_common/utils/passwords.py index 13bae4369..52ab57363 100644 --- a/tripleo_common/utils/passwords.py +++ b/tripleo_common/utils/passwords.py @@ -137,7 +137,7 @@ def get_snmpd_readonly_user_password(pw_file=None): return passlib.pwd.genword(length=24) else: with open(pw_file) as f: - passwords = yaml.load(f.read()) + passwords = yaml.safe_load(f.read()) return passwords['parameter_defaults']['SnmpdReadonlyUserPassword']