Skip to content

Commit

Permalink
use the recommended yaml.safe_load function
Browse files Browse the repository at this point in the history
reason: with pyyaml >= 5, the load function without Loader is deprecated.
Even if we do not use version 5 for now, we should use good practices.
https://pyyaml.org/wiki/PyYAMLDocumentation#loading-yaml
yaml/pyyaml#257
  • Loading branch information
fblackburn1 committed Apr 16, 2019
1 parent f986b7c commit 4abc3b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions integration_tests/suite/helpers/base.py
@@ -1,4 +1,4 @@
# Copyright 2018 The Wazo Authors (see the AUTHORS file)
# Copyright 2018-2019 The Wazo Authors (see the AUTHORS file)
# SPDX-License-Identifier: GPL-3.0-or-later

import os
Expand Down Expand Up @@ -109,7 +109,7 @@ def _get_service_config(self, service_name):
'cat',
'/var/lib/wazo-auth-keys/{}-key.yml'.format(service_name)
])
result = yaml.load(output.decode('utf-8'))
result = yaml.safe_load(output.decode('utf-8'))
print('_get_service_config sevrice: {}, result: {}'.format(service_name, result))
return result

Expand Down
4 changes: 2 additions & 2 deletions wazo_auth_keys/main.py
@@ -1,4 +1,4 @@
# Copyright 2018 The Wazo Authors (see the AUTHORS file)
# Copyright 2018-2019 The Wazo Authors (see the AUTHORS file)
# SPDX-License-Identifier: GPL-3.0-or-later

import os
Expand Down Expand Up @@ -68,7 +68,7 @@ def initialize_app(self, argv):
self._auth_config = dict(conf['auth'])

with open(self.options.config, 'r') as f:
self.services = yaml.load(f)
self.services = yaml.safe_load(f)
self.file_manager = FileManager(self, self.options.base_dir)


Expand Down

0 comments on commit 4abc3b6

Please sign in to comment.