community.aws icon indicating copy to clipboard operation
community.aws copied to clipboard

cloudfront_distribution_info summary fails with 'TypeError: CloudFrontFactsServiceManager.describe_cloudfront_property() takes 4 positional arguments but 5 were given'

Open kutzi opened this issue 10 months ago • 15 comments

Summary

I'm trying to get a summary of all cloudfront distributions. I.e.

community.aws.cloudfront_distribution_info:
    summary: true
    profile: "{{ aws_profile }}"
    region: "{{ aws_region }}

The call fails with:

n exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: CloudFrontFactsServiceManager.describe_cloudfront_property() takes 4 positional arguments but 5 were given
fatal: [DONT]: FAILED! => changed=false 
  module_stderr: |-
    Traceback (most recent call last):
      File "<stdin>", line 107, in <module>
      File "<stdin>", line 99, in _ansiballz_main
      File "<stdin>", line 47, in invoke_module
      File "/usr/lib/python3.10/runpy.py", line 224, in run_module
        return _run_module_code(code, init_globals, run_name, mod_spec)
      File "/usr/lib/python3.10/runpy.py", line 96, in _run_module_code
        _run_code(code, mod_globals, init_globals,
      File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
        exec(code, run_globals)
      File "/tmp/ansible_community.aws.cloudfront_distribution_info_payload_tdntauy7/ansible_community.aws.cloudfront_distribution_info_payload.zip/ansible_collections/community/aws/plugins/modules/cloudfront_distribution_info.py", line 408, in <module>
      File "/tmp/ansible_community.aws.cloudfront_distribution_info_payload_tdntauy7/ansible_community.aws.cloudfront_distribution_info_payload.zip/ansible_collections/community/aws/plugins/modules/cloudfront_distribution_info.py", line 399, in main
      File "/tmp/ansible_community.aws.cloudfront_distribution_info_payload_tdntauy7/ansible_community.aws.cloudfront_distribution_info_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/cloudfront_facts.py", line 158, in summary
      File "/tmp/ansible_community.aws.cloudfront_distribution_info_payload_tdntauy7/ansible_community.aws.cloudfront_distribution_info_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/cloudfront_facts.py", line 166, in summary_get_origin_access_identity_list
    TypeError: CloudFrontFactsServiceManager.describe_cloudfront_property() takes 4 positional arguments but 5 were given
  module_stdout: ''
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
  rc: 1

I tried to get the info with a single distribution (i.e. specify distribution: true and distribution_id instead of summary) and that works fine, so I assume that it's not a general issue with my ansible installation

Issue Type

Bug Report

Component Name

community.aws.cloudfront_info

Ansible Version

$ ansible --version
ansible-playbook [core 2.12.7]
  config file = /home/christoph.kutzinski/lab/platform/ansible.cfg
  configured module search path = ['/home/christoph.kutzinski/lab/platform/library', '/home/christoph.kutzinski/lab/platform/infrastructure/kubespray/library']
  ansible python module location = /home/christoph.kutzinski/.ansiblew/5.10.0/a7204d6c/ansible.29711/lib/python3.10/site-packages/ansible
  ansible collection location = /home/christoph.kutzinski/.ansiblew/5.10.0/a7204d6c/ansible/collections
  executable location = /home/christoph.kutzinski/.ansiblew/5.10.0/a7204d6c/ansible/bin/ansible-playbook
  python version = 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]
  jinja version = 3.1.2
  libyaml = True

Collection Versions

$ ansible-galaxy collection list
Collection    Version
------------- -------
amazon.aws    6.3.0  
ansible.utils 2.10.3 
community.aws 6.2.0  
ovirt.ovirt   3.1.2 

AWS SDK versions

$ pip show boto boto3 botocore
WARNING: Package(s) not found: boto
Name: boto3
Version: 1.28.21
Summary: The AWS SDK for Python
Home-page: https://github.com/boto/boto3
Author: Amazon Web Services
Author-email: 
License: Apache License 2.0
Location: /home/christoph.kutzinski/.ansiblew/5.10.0/a7204d6c/ansible.29711/lib/python3.10/site-packages
Requires: botocore, jmespath, s3transfer
Required-by: 
---
Name: botocore
Version: 1.31.21
Summary: Low-level, data-driven core of boto 3.
Home-page: https://github.com/boto/botocore
Author: Amazon Web Services
Author-email: 
License: Apache License 2.0
Location: /home/christoph.kutzinski/.ansiblew/5.10.0/a7204d6c/ansible.29711/lib/python3.10/site-packages
Requires: jmespath, python-dateutil, urllib3
Required-by: awscli, boto3, s3transfer

Configuration

$ ansible-config dump --only-changed

OS / Environment

Linux Mint

Steps to Reproduce

- name: List distributions
  community.aws.cloudfront_distribution_info:
    summary: true
    profile: "{{ aws_profile }}"
    region: "{{ aws_region }}"
  register: result

- debug: var=result

Expected Results

I expected the module to return a summary of all distributions

Actual Results

TASK [aws/cloudfront : List distributions] **************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: CloudFrontFactsServiceManager.describe_cloudfront_property() takes 4 positional arguments but 5 were given
fatal: [DONT]: FAILED! => changed=false 
  module_stderr: |-
    Traceback (most recent call last):
      File "<stdin>", line 107, in <module>
      File "<stdin>", line 99, in _ansiballz_main
      File "<stdin>", line 47, in invoke_module
      File "/usr/lib/python3.10/runpy.py", line 224, in run_module
        return _run_module_code(code, init_globals, run_name, mod_spec)
      File "/usr/lib/python3.10/runpy.py", line 96, in _run_module_code
        _run_code(code, mod_globals, init_globals,
      File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
        exec(code, run_globals)
      File "/tmp/ansible_community.aws.cloudfront_distribution_info_payload_tdntauy7/ansible_community.aws.cloudfront_distribution_info_payload.zip/ansible_collections/community/aws/plugins/modules/cloudfront_distribution_info.py", line 408, in <module>
      File "/tmp/ansible_community.aws.cloudfront_distribution_info_payload_tdntauy7/ansible_community.aws.cloudfront_distribution_info_payload.zip/ansible_collections/community/aws/plugins/modules/cloudfront_distribution_info.py", line 399, in main
      File "/tmp/ansible_community.aws.cloudfront_distribution_info_payload_tdntauy7/ansible_community.aws.cloudfront_distribution_info_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/cloudfront_facts.py", line 158, in summary
      File "/tmp/ansible_community.aws.cloudfront_distribution_info_payload_tdntauy7/ansible_community.aws.cloudfront_distribution_info_payload.zip/ansible_collections/amazon/aws/plugins/module_utils/cloudfront_facts.py", line 166, in summary_get_origin_access_identity_list
    TypeError: CloudFrontFactsServiceManager.describe_cloudfront_property() takes 4 positional arguments but 5 were given
  module_stdout: ''
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
  rc: 1

Code of Conduct

  • [X] I agree to follow the Ansible Code of Conduct

kutzi avatar Aug 14 '23 15:08 kutzi