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

[aws_s3] Local variable unassigned CI errors #338

Closed
jillr opened this issue Apr 23, 2021 · 3 comments · Fixed by #339
Closed

[aws_s3] Local variable unassigned CI errors #338

jillr opened this issue Apr 23, 2021 · 3 comments · Fixed by #339
Labels
bug This issue/PR relates to a bug has_pr module module needs_info This issue requires further information. Please answer any outstanding questions needs_template This issue/PR has an incomplete description. Please fill in the proposed template correctly needs_triage plugins plugin (any type) python3 traceback

Comments

@jillr
Copy link
Collaborator

jillr commented Apr 23, 2021

SUMMARY

Running aws_s3 tests from main:

TASK [aws_s3 : create an object from static content] ***************************
task path: /root/ansible_collections/amazon/aws/tests/output/.tmp/integration/aws_s3-_zddq632-ÅÑŚÌβŁÈ/tests/integration/targets/aws_s3/tasks/main.yml:529
<testhost> ESTABLISH LOCAL CONNECTION FOR USER: root
<testhost> EXEC /bin/sh -c 'echo ~root && sleep 0'
<testhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp `"&& mkdir "` echo /root/.ansible/tmp/ansible-tmp-1619213250.1790383-1424-6222423428195 `" && echo ansible-tmp-1619213250.1790383-1424-6222423428195="` echo /r
oot/.ansible/tmp/ansible-tmp-1619213250.1790383-1424-6222423428195 `" ) && sleep 0'
Using module file /root/ansible_collections/amazon/aws/plugins/modules/aws_s3.py
<testhost> PUT /root/.ansible/tmp/ansible-local-146oqzblnxj/tmpyrfcbwti TO /root/.ansible/tmp/ansible-tmp-1619213250.1790383-1424-6222423428195/AnsiballZ_aws_s3.py
<testhost> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1619213250.1790383-1424-6222423428195/ /root/.ansible/tmp/ansible-tmp-1619213250.1790383-1424-6222423428195/AnsiballZ_aws_s3.py && sleep 0'
<testhost> EXEC /bin/sh -c 'ANSIBLE_DEBUG_BOTOCORE_LOGS=True /usr/bin/python3.7 /root/.ansible/tmp/ansible-tmp-1619213250.1790383-1424-6222423428195/AnsiballZ_aws_s3.py && sleep 0'
<testhost> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1619213250.1790383-1424-6222423428195/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/root/.ansible/tmp/ansible-tmp-1619213250.1790383-1424-6222423428195/AnsiballZ_aws_s3.py", line 114, in <module>
    _ansiballz_main()
  File "/root/.ansible/tmp/ansible-tmp-1619213250.1790383-1424-6222423428195/AnsiballZ_aws_s3.py", line 106, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/root/.ansible/tmp/ansible-tmp-1619213250.1790383-1424-6222423428195/AnsiballZ_aws_s3.py", line 55, in invoke_module
    run_name='__main__', alter_sys=True)
  File "/usr/lib/python3.7/runpy.py", line 205, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_aws_s3_payload_ck2j7551/ansible_aws_s3_payload.zip/ansible_collections/amazon/aws/plugins/modules/aws_s3.py", line 947, in <module>
  File "/tmp/ansible_aws_s3_payload_ck2j7551/ansible_aws_s3_payload.zip/ansible_collections/amazon/aws/plugins/modules/aws_s3.py", line 845, in main
UnboundLocalError: local variable 'keyrtn' referenced before assignment
fatal: [testhost]: FAILED! => {
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1619213250.1790383-1424-6222423428195/AnsiballZ_aws_s3.py\", line 114, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansi
ble-tmp-1619213250.1790383-1424-6222423428195/AnsiballZ_aws_s3.py\", line 106, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-tmp-1619213250.1790383-1424-6222423428195/
AnsiballZ_aws_s3.py\", line 55, in invoke_module\n    run_name='__main__', alter_sys=True)\n  File \"/usr/lib/python3.7/runpy.py\", line 205, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/u
sr/lib/python3.7/runpy.py\", line 96, in _run_module_code\n    mod_name, mod_spec, pkg_name, script_name)\n  File \"/usr/lib/python3.7/runpy.py\", line 85, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_aws_s3_payload_c
k2j7551/ansible_aws_s3_payload.zip/ansible_collections/amazon/aws/plugins/modules/aws_s3.py\", line 947, in <module>\n  File \"/tmp/ansible_aws_s3_payload_ck2j7551/ansible_aws_s3_payload.zip/ansible_collections/amazon/aws/plugins/modules
/aws_s3.py\", line 845, in main\nUnboundLocalError: local variable 'keyrtn' referenced before assignment\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}

I don't quickly see any obvious diffs from when this broke, but it's a quick fix

ISSUE TYPE
  • Bug Report
COMPONENT NAME

aws_s3

@ansibullbot
Copy link

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link

@jillr: Greetings! Thanks for taking the time to open this issue. In order for the community to handle your issue effectively, we need a bit more information.

Here are the items we could not find in your description:

  • ansible version

Please set the description of this issue with this template:
https://raw.githubusercontent.com/ansible/ansible/devel/.github/ISSUE_TEMPLATE/bug_report.md

click here for bot help

@ansibullbot
Copy link

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module needs_info This issue requires further information. Please answer any outstanding questions needs_template This issue/PR has an incomplete description. Please fill in the proposed template correctly needs_triage plugins plugin (any type) python3 traceback labels Apr 23, 2021
abikouo pushed a commit to abikouo/amazon.aws that referenced this issue Sep 18, 2023
…ible-collections#340)

ecs_service - support setting deployment controller on a service

SUMMARY
Support setting platform version to 1.4.0 (LATEST is 1.3.0) and deployment controller.
The first allows access to new 1.4.0 features. The second change allows you to create a service that can be controlled with Code Deploy.
Example:
  - name: create a Fargate service
    community.aws.ecs_service:
      state: present
      name: "my-service"
      cluster: "my-cluster"
      platform_version: 1.4.0
      task_definition: "my-task"
      desired_count: "1"
      launch_type: FARGATE
      scheduling_strategy: REPLICA
      deployment_controller:
        type: CODE_DEPLOY
      load_balancers:
        - targetGroupArn: "arn:..."
          containerName: example
          containerPort: 80
      network_configuration:
        subnets:
          - "{{vpc_zone_a.subnet.id}}"
          - "{{vpc_zone_b.subnet.id}}"
        security_groups:
          - "sg-example"
        assign_public_ip: true

This fixes ansible-collections#338.
ISSUE TYPE

Feature Pull Request

Reviewed-by: Jill R <None>
Reviewed-by: Mark Chappell <None>
Reviewed-by: Markus Bergholz <[email protected]>
abikouo pushed a commit to abikouo/amazon.aws that referenced this issue Sep 18, 2023
…ible-collections#340)

ecs_service - support setting deployment controller on a service

SUMMARY
Support setting platform version to 1.4.0 (LATEST is 1.3.0) and deployment controller.
The first allows access to new 1.4.0 features. The second change allows you to create a service that can be controlled with Code Deploy.
Example:
  - name: create a Fargate service
    community.aws.ecs_service:
      state: present
      name: "my-service"
      cluster: "my-cluster"
      platform_version: 1.4.0
      task_definition: "my-task"
      desired_count: "1"
      launch_type: FARGATE
      scheduling_strategy: REPLICA
      deployment_controller:
        type: CODE_DEPLOY
      load_balancers:
        - targetGroupArn: "arn:..."
          containerName: example
          containerPort: 80
      network_configuration:
        subnets:
          - "{{vpc_zone_a.subnet.id}}"
          - "{{vpc_zone_b.subnet.id}}"
        security_groups:
          - "sg-example"
        assign_public_ip: true

This fixes ansible-collections#338.
ISSUE TYPE

Feature Pull Request

Reviewed-by: Jill R <None>
Reviewed-by: Mark Chappell <None>
Reviewed-by: Markus Bergholz <[email protected]>
abikouo pushed a commit to abikouo/amazon.aws that referenced this issue Oct 24, 2023
…ible-collections#340)

ecs_service - support setting deployment controller on a service

SUMMARY
Support setting platform version to 1.4.0 (LATEST is 1.3.0) and deployment controller.
The first allows access to new 1.4.0 features. The second change allows you to create a service that can be controlled with Code Deploy.
Example:
  - name: create a Fargate service
    community.aws.ecs_service:
      state: present
      name: "my-service"
      cluster: "my-cluster"
      platform_version: 1.4.0
      task_definition: "my-task"
      desired_count: "1"
      launch_type: FARGATE
      scheduling_strategy: REPLICA
      deployment_controller:
        type: CODE_DEPLOY
      load_balancers:
        - targetGroupArn: "arn:..."
          containerName: example
          containerPort: 80
      network_configuration:
        subnets:
          - "{{vpc_zone_a.subnet.id}}"
          - "{{vpc_zone_b.subnet.id}}"
        security_groups:
          - "sg-example"
        assign_public_ip: true

This fixes ansible-collections#338.
ISSUE TYPE

Feature Pull Request

Reviewed-by: Jill R <None>
Reviewed-by: Mark Chappell <None>
Reviewed-by: Markus Bergholz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug has_pr module module needs_info This issue requires further information. Please answer any outstanding questions needs_template This issue/PR has an incomplete description. Please fill in the proposed template correctly needs_triage plugins plugin (any type) python3 traceback
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants