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

wafv2_web_acl: prevent exception when element is not a dict #962

Merged
merged 5 commits into from
Mar 15, 2022
Merged

wafv2_web_acl: prevent exception when element is not a dict #962

merged 5 commits into from
Mar 15, 2022

Conversation

markuman
Copy link
Member

@markuman markuman commented Mar 3, 2022

SUMMARY

the geo_match_statement statement paremeter country_codes is a list and will fail the current implementation

  File "/tmp/ansible_community.aws.wafv2_web_acl_payload_8xvwtxvw/ansible_community.aws.wafv2_web_acl_payload.zip/ansible_collections/community/aws/plugins/module_utils/wafv2.py", line 52, in wafv2_snake_dict_to_camel_dict
AttributeError: 'str' object has no attribute 'keys'
rules:
    - name: block-germany
      priority: 0
      action:
        block: {}
      visibility_config:
        sampled_requests_enabled: yes
        cloud_watch_metrics_enabled: yes
        metric_name: block-germany
      statement:
        geo_match_statement:
          country_codes:
             - DE
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

plugins/module_utils/wafv2.py

ADDITIONAL INFORMATION

@ansibullbot ansibullbot added bug This issue/PR relates to a bug community_review integration tests/integration needs_triage tests tests traceback labels Mar 3, 2022
@markuman markuman added backport-3 PR should be backported to the stable-3 branch backport-2 PR should be backported to the stable-2 branch mergeit Merge the PR (SoftwareFactory) labels Mar 11, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 9230c69 into ansible-collections:main Mar 15, 2022
@patchback
Copy link

patchback bot commented Mar 15, 2022

Backport to stable-2: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-2/9230c6986eea7f041796cb21640c7fd28bc24c4d/pr-962

Backported as #991

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Mar 15, 2022
wafv2_web_acl: prevent exception when element is not a dict

SUMMARY
the geo_match_statement statement paremeter country_codes is a list and will fail the current implementation
  File "/tmp/ansible_community.aws.wafv2_web_acl_payload_8xvwtxvw/ansible_community.aws.wafv2_web_acl_payload.zip/ansible_collections/community/aws/plugins/module_utils/wafv2.py", line 52, in wafv2_snake_dict_to_camel_dict
AttributeError: 'str' object has no attribute 'keys'

rules:
    - name: block-germany
      priority: 0
      action:
        block: {}
      visibility_config:
        sampled_requests_enabled: yes
        cloud_watch_metrics_enabled: yes
        metric_name: block-germany
      statement:
        geo_match_statement:
          country_codes:
             - DE
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/module_utils/wafv2.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>
(cherry picked from commit 9230c69)
@patchback
Copy link

patchback bot commented Mar 15, 2022

Backport to stable-3: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-3/9230c6986eea7f041796cb21640c7fd28bc24c4d/pr-962

Backported as #992

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Mar 15, 2022
wafv2_web_acl: prevent exception when element is not a dict

SUMMARY
the geo_match_statement statement paremeter country_codes is a list and will fail the current implementation
  File "/tmp/ansible_community.aws.wafv2_web_acl_payload_8xvwtxvw/ansible_community.aws.wafv2_web_acl_payload.zip/ansible_collections/community/aws/plugins/module_utils/wafv2.py", line 52, in wafv2_snake_dict_to_camel_dict
AttributeError: 'str' object has no attribute 'keys'

rules:
    - name: block-germany
      priority: 0
      action:
        block: {}
      visibility_config:
        sampled_requests_enabled: yes
        cloud_watch_metrics_enabled: yes
        metric_name: block-germany
      statement:
        geo_match_statement:
          country_codes:
             - DE
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
plugins/module_utils/wafv2.py
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>
(cherry picked from commit 9230c69)
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Mar 15, 2022
)

[PR #962/9230c698 backport][stable-3] wafv2_web_acl: prevent exception when element is not a dict

This is a backport of PR #962 as merged into main (9230c69).
SUMMARY
the geo_match_statement statement paremeter country_codes is a list and will fail the current implementation
  File "/tmp/ansible_community.aws.wafv2_web_acl_payload_8xvwtxvw/ansible_community.aws.wafv2_web_acl_payload.zip/ansible_collections/community/aws/plugins/module_utils/wafv2.py", line 52, in wafv2_snake_dict_to_camel_dict
AttributeError: 'str' object has no attribute 'keys'

rules:
    - name: block-germany
      priority: 0
      action:
        block: {}
      visibility_config:
        sampled_requests_enabled: yes
        cloud_watch_metrics_enabled: yes
        metric_name: block-germany
      statement:
        geo_match_statement:
          country_codes:
             - DE
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME
plugins/module_utils/wafv2.py
ADDITIONAL INFORMATION
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Mar 15, 2022
)

[PR #962/9230c698 backport][stable-2] wafv2_web_acl: prevent exception when element is not a dict

This is a backport of PR #962 as merged into main (9230c69).
SUMMARY
the geo_match_statement statement paremeter country_codes is a list and will fail the current implementation
  File "/tmp/ansible_community.aws.wafv2_web_acl_payload_8xvwtxvw/ansible_community.aws.wafv2_web_acl_payload.zip/ansible_collections/community/aws/plugins/module_utils/wafv2.py", line 52, in wafv2_snake_dict_to_camel_dict
AttributeError: 'str' object has no attribute 'keys'

rules:
    - name: block-germany
      priority: 0
      action:
        block: {}
      visibility_config:
        sampled_requests_enabled: yes
        cloud_watch_metrics_enabled: yes
        metric_name: block-germany
      statement:
        geo_match_statement:
          country_codes:
             - DE
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME
plugins/module_utils/wafv2.py
ADDITIONAL INFORMATION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-2 PR should be backported to the stable-2 branch backport-3 PR should be backported to the stable-3 branch bug This issue/PR relates to a bug community_review integration tests/integration mergeit Merge the PR (SoftwareFactory) needs_triage tests tests traceback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants