ipatests: webui: Use safe-loader for loading YAML configuration file
FullLoader class for YAML loader was introduced in version 5.1 which also deprecated default loader. SafeLoader, however, stays consistent across the versions and brings added security. This fix is necessary as PyYAML > 5.1 is not available in downstream. Related: https://pagure.io/freeipa/issue/9009 Signed-off-by: Michal Polovka <mpolovka@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
1 parent
cd735099e8
commit
419d7fd6e5
1 file changed
+1
-1
@@ -192,7 +192,7 @@ class UI_driver:
|
||||
if not NO_YAML and os.path.isfile(path):
|
||||
try:
|
||||
with open(path, 'r') as conf:
|
||||
cls.config = yaml.load(stream=conf, Loader=yaml.FullLoader)
|
||||
cls.config = yaml.safe_load(stream=conf)
|
||||
except yaml.YAMLError as e:
|
||||
pytest.skip("Invalid Web UI config.\n%s" % e)
|
||||
except IOError as e:
|
||||
|
||||
Reference in new issue
Block a user