mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-08-09 12:38:14 -05:00
Added a user-friendly output to an import error
Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
committed by
Martin Basti
parent
1255dbf2fd
commit
b93137c196
@@ -107,7 +107,11 @@ def get_global_config(env=None):
|
||||
|
||||
def config_from_env(env):
|
||||
if 'IPATEST_YAML_CONFIG' in env:
|
||||
import yaml
|
||||
try:
|
||||
import yaml
|
||||
except ImportError as e:
|
||||
raise ImportError("%s, please install PyYAML package to fix it" %
|
||||
e.message)
|
||||
with open(env['IPATEST_YAML_CONFIG']) as file:
|
||||
confdict = yaml.safe_load(file)
|
||||
return Config.from_dict(confdict)
|
||||
|
||||
Reference in New Issue
Block a user