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

Fix test_dynamic_acl incompatible issue on dualtor #17274

Merged

Conversation

ZhaohuiS
Copy link
Contributor

@ZhaohuiS ZhaohuiS commented Mar 1, 2025

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

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ZhaohuiS ZhaohuiS changed the title Fix test_dynamic_acl uncompatible issue on dualtor Fix test_dynamic_acl incompatible issue on dualtor Mar 1, 2025
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Collaborator

@yejianquan yejianquan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yejianquan yejianquan merged commit b3055a8 into sonic-net:master Mar 3, 2025
15 checks passed
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Mar 3, 2025
* 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 pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Mar 3, 2025
* 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

Cherry-pick PR to 202405: #17287

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202411: #17286

mssonicbld pushed a commit that referenced this pull request Mar 3, 2025
* 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 pushed a commit that referenced this pull request Mar 3, 2025
* 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]>
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.

3 participants