Merge "Correct YAML load warning" into stable/train

This commit is contained in:
Zuul 2020-08-13 22:14:48 +00:00 committed by Gerrit Code Review
commit 4721ead5f0
4 changed files with 6 additions and 6 deletions

View File

@ -41,7 +41,7 @@ def export_passwords(swift, stack, excludes=True):
"file from swift: %s", str(e))
sys.exit(1)
data = yaml.load(content)["passwords"]
data = yaml.safe_load(content)["passwords"]
if excludes:
excluded_passwords = []
for k in data:

View File

@ -48,7 +48,7 @@ class TestOvercloudUpdatePrepare(fakes.TestOvercloudUpdatePrepare):
@mock.patch('tripleoclient.workflows.package_update.update',
autospec=True)
@mock.patch('os.path.abspath')
@mock.patch('yaml.load')
@mock.patch('yaml.safe_load')
@mock.patch('shutil.copytree', autospec=True)
@mock.patch('six.moves.builtins.open')
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.'
@ -88,7 +88,7 @@ class TestOvercloudUpdatePrepare(fakes.TestOvercloudUpdatePrepare):
autospec=True)
@mock.patch('six.moves.builtins.open')
@mock.patch('os.path.abspath')
@mock.patch('yaml.load')
@mock.patch('yaml.safe_load')
@mock.patch('shutil.copytree', autospec=True)
@mock.patch('tripleoclient.v1.overcloud_deploy.DeployOvercloud.'
'_deploy_tripleo_heat_templates', autospec=True)

View File

@ -50,7 +50,7 @@ class TestOvercloudUpgradePrepare(fakes.TestOvercloudUpgradePrepare):
autospec=True)
@mock.patch('tripleoclient.v1.overcloud_upgrade.UpgradePrepare.log',
autospec=True)
@mock.patch('yaml.load')
@mock.patch('yaml.safe_load')
@mock.patch('six.moves.builtins.open')
def test_upgrade_out(self,
mock_open,
@ -103,7 +103,7 @@ class TestOvercloudUpgradePrepare(fakes.TestOvercloudUpgradePrepare):
autospec=True)
@mock.patch('tripleoclient.utils.prepend_environment', autospec=True)
@mock.patch('six.moves.builtins.open')
@mock.patch('yaml.load')
@mock.patch('yaml.safe_load')
def test_upgrade_failed(self, mock_yaml, mock_open,
add_env, mock_get_stack, mock_overcloud_deploy,
mock_confirm):

View File

@ -2134,7 +2134,7 @@ def check_file_for_enabled_service(env_file):
"""
if os.path.exists(env_file):
with open(env_file, "r") as f:
content = yaml.load(f)
content = yaml.safe_load(f)
deprecated_services_enabled = []
for service in constants.DEPRECATED_SERVICES.keys():
try: