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

[action] [PR:17274] Fix test_dynamic_acl incompatible issue on dualtor #17286

Merged
merged 1 commit into from
Mar 3, 2025

Conversation

mssonicbld
Copy link
Collaborator

Description of PR

Summary:
Fixes # (issue)
test_dynamic_acl failed on dualtor testbed due to:

28/02/2025 16:40:42 __init__._fixture_func_decorator L0073 ERROR | 
AttributeError("'AnsibleUnsafeText' object has no attribute 'get'")
Traceback (most recent call last):
 File "/data/tests/common/plugins/log_section_start/__init__.py", line 71, in _fixture_func_decorator
 return fixture_func(*args, **kargs)
 File "/data/tests/generic_config_updater/test_dynamic_acl.py", line 227, in setup 
 if config_facts['VLAN_INTERFACE'][vlan_name][vlan_ip_address].get("secondary"):
AttributeError: 'AnsibleUnsafeText' object has no attribute 'get'

It's because the VLAN_INTERFACE is like this on dualtor:

 "VLAN_INTERFACE": {
 "Vlan1000": {
 "grat_arp": "enabled",
 "proxy_arp": "enabled",
 "192.168.0.1/21": {
 
 },
 "fc02:1000::1/64": {
 
 }
 }
 },

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
  • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405
  • 202411

Approach

What is the motivation for this PR?

How did you do it?

Avoid to get secondary key from a string object

How did you verify/test it?

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

* Fix test_dynamic_acl uncompatible issue on dualtor

Signed-off-by: Zhaohui Sun <[email protected]>

Description of PR
Summary:
Fixes # (issue)
test_dynamic_acl failed on dualtor testbed due to:

28/02/2025 16:40:42 __init__._fixture_func_decorator         L0073 ERROR  |               
AttributeError("'AnsibleUnsafeText' object has no attribute 'get'")
Traceback (most recent call last):
  File "/data/tests/common/plugins/log_section_start/__init__.py", line 71, in _fixture_func_decorator
    return fixture_func(*args, **kargs)
  File "/data/tests/generic_config_updater/test_dynamic_acl.py", line 227, in setup  
    if config_facts['VLAN_INTERFACE'][vlan_name][vlan_ip_address].get("secondary"):
AttributeError: 'AnsibleUnsafeText' object has no attribute 'get'

It's because the VLAN_INTERFACE is like this on dualtor:

    "VLAN_INTERFACE": {
      "Vlan1000": {
        "grat_arp": "enabled",
        "proxy_arp": "enabled",
        "192.168.0.1/21": {
          
        },
        "fc02:1000::1/64": {
          
        }
      }
    },

Approach
What is the motivation for this PR?
How did you do it?
Avoid to get secondary key from a string object
Signed-off-by: Zhaohui Sun <[email protected]>
@mssonicbld
Copy link
Collaborator Author

/azp run

@mssonicbld
Copy link
Collaborator Author

Original PR: #17274

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld mssonicbld merged commit 7d00028 into sonic-net:202411 Mar 3, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants