[Bug 271198] sysutils/ansible: probably missing py-toml dependency

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 02 May 2023 11:53:52 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271198

            Bug ID: 271198
           Summary: sysutils/ansible: probably missing py-toml dependency
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: 0mp@FreeBSD.org
          Reporter: mikael@FreeBSD.org
             Flags: maintainer-feedback?(0mp@FreeBSD.org)
          Assignee: 0mp@FreeBSD.org

I'm hitting the following issue:
AttributeError: module 'toml' has no attribute 'loads'

full backtrace:

ansible-playbook [core 2.14.3]
  config file = /usr/local/etc/ansible/ansible.cfg
  configured module search path = ['/home/toto/.ansible/plugins/modules',
'/usr/local/share/py39-ansible/plugins/modules']
  ansible python module location =
/usr/local/lib/python3.9/site-packages/ansible
  ansible collection location =
/home/toto/.ansible/collections:/usr/local/share/py39-ansible/collections
  executable location = /usr/local/bin/ansible-playbook
  python version = 3.9.16 (main, Feb 28 2023, 01:31:45) [Clang 15.0.7
(https://github.com/llvm/llvm-project.git llvmorg-15.0.7-0-g8dfdc
(/usr/local/bin/python3.9)
  jinja version = 3.1.2
  libyaml = True
Using /usr/local/etc/ansible/ansible.cfg as config file
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
647, in cli_executor
    exit_code = cli.run()
  File "/usr/local/lib/python3.9/site-packages/ansible/cli/playbook.py", line
124, in run
    loader, inventory, variable_manager = self._play_prereqs()
  File "/usr/local/lib/python3.9/site-packages/ansible/cli/__init__.py", line
552, 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
853, in get
    return self.get_with_context(name, *args, **kwargs).object
  File "/usr/local/lib/python3.9/site-packages/ansible/plugins/loader.py", line
876, 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
826, 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'
Exit 250

Installing textproc/py-toml fixes the issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.