mirror of
https://abf.rosa.ru/djam/abf-console-client-src.git
synced 2025-02-23 09:52:48 +00:00
Adapt for python-yaml 5.2 (RB#10720)
``` abf/console/misc.py:239: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. yaml_data = yaml.load(fd) ``` https://bugzilla.rosalinux.ru/show_bug.cgi?id=10720#c4
This commit is contained in:
parent
94f0cfea37
commit
64f189becf
1 changed files with 3 additions and 3 deletions
|
@ -236,7 +236,7 @@ def find_spec_problems(exit_on_error=True, strict=False, auto_remove=False):
|
||||||
if os.path.isfile(yaml_path):
|
if os.path.isfile(yaml_path):
|
||||||
with open(yaml_path, 'r') as fd:
|
with open(yaml_path, 'r') as fd:
|
||||||
try:
|
try:
|
||||||
yaml_data = yaml.load(fd)
|
yaml_data = yaml.safe_load(fd)
|
||||||
except yaml.scanner.ScannerError as ex:
|
except yaml.scanner.ScannerError as ex:
|
||||||
log.error(_('Invalid yml file %(file)s!\nProblem in line %(line)d column %(col)d: %(exception)s') % {'file': yaml_path, 'line': ex.problem_mark.line, 'col': ex.problem_mark.column, 'exception': ex.problem})
|
log.error(_('Invalid yml file %(file)s!\nProblem in line %(line)d column %(col)d: %(exception)s') % {'file': yaml_path, 'line': ex.problem_mark.line, 'col': ex.problem_mark.column, 'exception': ex.problem})
|
||||||
except yaml.composer.ComposerError as ex:
|
except yaml.composer.ComposerError as ex:
|
||||||
|
@ -463,7 +463,7 @@ def is_text_file(path):
|
||||||
|
|
||||||
def fetch_files(models, yaml_path, file_names=None):
|
def fetch_files(models, yaml_path, file_names=None):
|
||||||
with open(yaml_path, 'r') as fd:
|
with open(yaml_path, 'r') as fd:
|
||||||
yaml_data = yaml.load(fd)
|
yaml_data = yaml.safe_load(fd)
|
||||||
if not yaml_data or not 'sources' in yaml_data:
|
if not yaml_data or not 'sources' in yaml_data:
|
||||||
log.error(_("Incorrect .abf.yml file: no 'sources' key."))
|
log.error(_("Incorrect .abf.yml file: no 'sources' key."))
|
||||||
exit(1)
|
exit(1)
|
||||||
|
@ -504,7 +504,7 @@ def upload_files(models, min_size, path=None, remove_files=True, upload_all=Fals
|
||||||
if os.path.isfile(yaml_path):
|
if os.path.isfile(yaml_path):
|
||||||
with open(yaml_path, 'r') as fd:
|
with open(yaml_path, 'r') as fd:
|
||||||
try:
|
try:
|
||||||
yaml_data = yaml.load(fd)
|
yaml_data = yaml.safe_load(fd)
|
||||||
except (yaml.composer.ComposerError, yaml.scanner.ScannerError) :
|
except (yaml.composer.ComposerError, yaml.scanner.ScannerError) :
|
||||||
log.error(_('Could not parse .abf.yml file. It seems to be corrupted and will be rewritten.'))
|
log.error(_('Could not parse .abf.yml file. It seems to be corrupted and will be rewritten.'))
|
||||||
yaml_file_changed = True
|
yaml_file_changed = True
|
||||||
|
|
Loading…
Add table
Reference in a new issue