Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyYAML dependency should have a minimum version #304

Closed
rpignolet opened this issue Mar 7, 2023 · 0 comments · Fixed by #341
Closed

PyYAML dependency should have a minimum version #304

rpignolet opened this issue Mar 7, 2023 · 0 comments · Fixed by #341
Assignees

Comments

@rpignolet
Copy link
Collaborator

Currently the PyYAML dependency is

PyYAML = "<6.0.0"

When using PyYAML 3.12 (default version for Rocky 8) I have this error when running tdp init:

2023-03-07 11:41:56,579 - DEBUG - tdp.<module> - Logger initialized
2023-03-07 11:41:57,958 - INFO - tdp.cluster_variables.initialize_cluster_variables - /opt/tdp-manager/tdp_vars/all does not exist, created
2023-03-07 11:41:57,973 - INFO - tdp.service_variables.update_from_variables_folder - Updating all with variables from /opt/tdp-manager/ansible_collections/tosit/tdp/tdp_vars_defaults/all/all.yml
Traceback (most recent call last):
  File "/opt/tdp-manager/venv/bin/tdp", line 8, in <module>
    sys.exit(tdp())
  File "/opt/tdp-manager/venv/lib64/python3.6/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/opt/tdp-manager/venv/lib64/python3.6/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/opt/tdp-manager/venv/lib64/python3.6/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/tdp-manager/venv/lib64/python3.6/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/tdp-manager/venv/lib64/python3.6/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/opt/tdp-manager/tdp-lib/tdp/cli/commands/init.py", line 28, in init
    collections, vars, overrides, validate=validate
  File "/opt/tdp-manager/tdp-lib/tdp/core/variables/cluster_variables.py", line 95, in initialize_cluster_variables
    "add variables from " + collection_name, path
  File "/opt/tdp-manager/tdp-lib/tdp/core/variables/service_variables.py", line 100, in update_from_variables_folder
    configurations[file.name].merge(variables)
  File "/usr/lib64/python3.6/contextlib.py", line 88, in __exit__
    next(self.gen)
  File "/opt/tdp-manager/tdp-lib/tdp/core/variables/service_variables.py", line 145, in open_var_files
    stack.close()
  File "/usr/lib64/python3.6/contextlib.py", line 336, in close
    self.__exit__(None, None, None)
  File "/usr/lib64/python3.6/contextlib.py", line 380, in __exit__
    raise exc_details[1]
  File "/usr/lib64/python3.6/contextlib.py", line 365, in __exit__
    if cb(*exc_details):
  File "/usr/lib64/python3.6/contextlib.py", line 284, in _exit_wrapper
    return cm_exit(cm, *exc_details)
  File "/usr/lib64/python3.6/contextlib.py", line 88, in __exit__
    next(self.gen)
  File "/opt/tdp-manager/tdp-lib/tdp/core/variables/service_variables.py", line 121, in _open_var_file
    yield variables
  File "/opt/tdp-manager/tdp-lib/tdp/core/variables/variables.py", line 112, in __exit__
    self.close()
  File "/opt/tdp-manager/tdp-lib/tdp/core/variables/variables.py", line 134, in close
    self._flush_on_disk()
  File "/opt/tdp-manager/tdp-lib/tdp/core/variables/variables.py", line 125, in _flush_on_disk
    yaml.dump(self._content, Dumper=Dumper, sort_keys=False, width=1000)
  File "/usr/lib64/python3.6/site-packages/yaml/__init__.py", line 200, in dump
    return dump_all([data], stream, Dumper=Dumper, **kwds)
TypeError: dump_all() got an unexpected keyword argument 'sort_keys'

We need a minimum version for PyYAML.

@rpignolet rpignolet self-assigned this Mar 7, 2023
@rpignolet rpignolet removed their assignment May 16, 2023
@mdrutel mdrutel self-assigned this Jun 30, 2023
@mdrutel mdrutel linked a pull request Jun 30, 2023 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants