Bug 272811 - sysutils/py-ansible-core: Missing dependency on textproc/py-toml
Summary: sysutils/py-ansible-core: Missing dependency on textproc/py-toml
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Guido Falsi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-30 07:57 UTC by Guido Falsi
Modified: 2023-07-30 15:44 UTC (History)
2 users (show)

See Also:
0mp: maintainer-feedback+


Attachments
patch v1 (934 bytes, patch)
2023-07-30 07:57 UTC, Guido Falsi
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Guido Falsi freebsd_committer freebsd_triage 2023-07-30 07:57:25 UTC
Created attachment 243700 [details]
patch v1

Hi,

After recent updates to the ports tree a pkg upgrade followed by pkg autoremove deleted the py-toml port considering it an orphan, on machines where I have ansible installed.

After this ansible started failing with the following error:

ERROR! Unexpected Exception, this is probably a bug: module 'toml' has no attribute 'loads'
the full traceback was:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/ansible/cli/__init__.py", line 659, in cli_executor
    exit_code = cli.run()
  File "/usr/local/lib/python3.9/site-packages/ansible/cli/adhoc.py", line 117, in run
    loader, inventory, variable_manager = self._play_prereqs()
  File "/usr/local/lib/python3.9/site-packages/ansible/cli/__init__.py", line 564, in _play_prereqs
    inventory = InventoryManager(loader=loader, sources=options['inventory'], cache=(not options.get('flush_cache')))
  File "/usr/local/lib/python3.9/site-packages/ansible/inventory/manager.py", line 167, in __init__
    self.parse_sources(cache=cache)
  File "/usr/local/lib/python3.9/site-packages/ansible/inventory/manager.py", line 228, in parse_sources
    parse = self.parse_source(source, cache=cache)
  File "/usr/local/lib/python3.9/site-packages/ansible/inventory/manager.py", line 279, in parse_source
    for plugin in self._fetch_inventory_plugins():
  File "/usr/local/lib/python3.9/site-packages/ansible/inventory/manager.py", line 207, in _fetch_inventory_plugins
    plugin = inventory_loader.get(name)
  File "/usr/local/lib/python3.9/site-packages/ansible/plugins/loader.py", line 855, in get
    return self.get_with_context(name, *args, **kwargs).object
  File "/usr/local/lib/python3.9/site-packages/ansible/plugins/loader.py", line 878, in get_with_context
    self._module_cache[path] = self._load_module_source(name, path)
  File "/usr/local/lib/python3.9/site-packages/ansible/plugins/loader.py", line 828, in _load_module_source
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/local/lib/python3.9/site-packages/ansible/plugins/inventory/toml.py", line 161, in <module>
    toml_loads = toml.loads  # type: ignore[assignment]
AttributeError: module 'toml' has no attribute 'loads'


So it looks like toml is an actual ansible unregistered dependency that happened to be installed by some other dependency an is not being anymore.

I'm attaching a very simple patch I'm using locally that fixes the issue for me.
Can you commit it or approve me committing it?

Thanks in advance!
Comment 1 Mateusz Piotrowski freebsd_committer freebsd_triage 2023-07-30 12:04:25 UTC
Definitely, please go ahead and commit the necessary fix! Thanks!
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-07-30 15:42:36 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4420fef3e1d9e15da994ee9f9d4e0e738500a96a

commit 4420fef3e1d9e15da994ee9f9d4e0e738500a96a
Author:     Guido Falsi <madpilot@FreeBSD.org>
AuthorDate: 2023-07-30 15:41:03 +0000
Commit:     Guido Falsi <madpilot@FreeBSD.org>
CommitDate: 2023-07-30 15:41:03 +0000

    sysutils/py-ansible-core: Add missing dependency on py-toml

    PR:             272811
    Approved by:    0mp (maintainer)

 sysutils/py-ansible-core/Makefile | 2 ++
 1 file changed, 2 insertions(+)
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-07-30 15:43:37 UTC
A commit in branch 2023Q3 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=177c62956a3d0197b0ac9839a6cd668b8a75cf4c

commit 177c62956a3d0197b0ac9839a6cd668b8a75cf4c
Author:     Guido Falsi <madpilot@FreeBSD.org>
AuthorDate: 2023-07-30 15:41:03 +0000
Commit:     Guido Falsi <madpilot@FreeBSD.org>
CommitDate: 2023-07-30 15:42:55 +0000

    sysutils/py-ansible-core: Add missing dependency on py-toml

    PR:             272811
    Approved by:    0mp (maintainer)

    (cherry picked from commit 4420fef3e1d9e15da994ee9f9d4e0e738500a96a)

 sysutils/py-ansible-core/Makefile | 2 ++
 1 file changed, 2 insertions(+)
Comment 4 Guido Falsi freebsd_committer freebsd_triage 2023-07-30 15:44:56 UTC
Committed. Thanks!