Skip to content

Commit 4abc3b6

Browse files
committed
use the recommended yaml.safe_load function
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
1 parent f986b7c commit 4abc3b6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

integration_tests/suite/helpers/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018 The Wazo Authors (see the AUTHORS file)
1+
# Copyright 2018-2019 The Wazo Authors (see the AUTHORS file)
22
# SPDX-License-Identifier: GPL-3.0-or-later
33

44
import os
@@ -109,7 +109,7 @@ def _get_service_config(self, service_name):
109109
'cat',
110110
'/var/lib/wazo-auth-keys/{}-key.yml'.format(service_name)
111111
])
112-
result = yaml.load(output.decode('utf-8'))
112+
result = yaml.safe_load(output.decode('utf-8'))
113113
print('_get_service_config sevrice: {}, result: {}'.format(service_name, result))
114114
return result
115115

wazo_auth_keys/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2018 The Wazo Authors (see the AUTHORS file)
1+
# Copyright 2018-2019 The Wazo Authors (see the AUTHORS file)
22
# SPDX-License-Identifier: GPL-3.0-or-later
33

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

7070
with open(self.options.config, 'r') as f:
71-
self.services = yaml.load(f)
71+
self.services = yaml.safe_load(f)
7272
self.file_manager = FileManager(self, self.options.base_dir)
7373

7474

0 commit comments

Comments
 (0)