Skip to content

Import error Consul.Agent with community.general.consul #11040

@mlech-reef

Description

@mlech-reef

Summary

Consul module is referring to consul.Consul.Agent which doesn't exist in py-consul

I tested with the version 12.0.0 and py-consul 1.5 and 1.6

~/Workspace/oss/community.general main• ❱ git sh-s
commit c984b89667dc2b555f3f4dbf43cfd2708e890681 (HEAD -> main, origin/main, origin/HEAD)
Author:     Alexei Znamensky <[email protected]>
AuthorDate: Fri Nov 7 10:29:44 2025 +1300
Commit:     GitHub <[email protected]>
CommitDate: Fri Nov 7 10:29:44 2025 +1300

    docs style adjustments (#11037)
    
    docs adjustments
~/Workspace/oss/community.general main• ❱ rg 'Consul\.Agent'
plugins/modules/consul.py
229:    class PatchedConsulAgentService(consul.Consul.Agent.Service):

tmp/collections/ansible_collections/community/general/plugins/modules/consul.py
248:    class PatchedConsulAgentService(consul.Consul.Agent.Service):

Issue Type

Bug Report

Component Name

consul

Ansible Version

$ ansible --version
ansible [core 2.19.4]

Community.general Version

12.0.0

Configuration

$ ansible-config dump --only-changed
N/A

OS / Environment

Fedora Silverblue/Debian Trixie

Steps to Reproduce

Any usage of community.general.consul with most recent version of py-consul

Expected Results

It works without error

Actual Results

ImportError Consul.Agent

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue/PR relates to a bugmodulemodulepluginsplugin (any type)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions