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

[qos_sai] portName referenced before assignment on t1-lag topo #6864

Closed
vcheketx opened this issue Nov 21, 2022 · 1 comment · Fixed by #6865
Closed

[qos_sai] portName referenced before assignment on t1-lag topo #6864

vcheketx opened this issue Nov 21, 2022 · 1 comment · Fixed by #6865

Comments

@vcheketx
Copy link
Contributor

Description

PR 6393 switched to using portName instead of iface for t1 topos.
Since portName is defined inside if loop, it results in variable referenced before assignment error if interfaces names do not contain '.'
Steps to reproduce the issue:

  1. deploy t1-lag topo
  2. run qos/test_qos_sai.py

Describe the results you received:

                if iface.startswith("Ethernet"):
                    if "." in iface:
                        portName, vlan_id = iface.split(".")
>                   portIndex = mgFacts["minigraph_ptf_indices"][portName]
E                   UnboundLocalError: local variable 'portName' referenced before assignment

Describe the results you expected:
Tests are passed.

Additional information you deem important:

**Output of `show version`:**
SONiC Software Version: SONiC.master.172539-dirty-20221110.175553
Distribution: Debian 11.5
Kernel: 5.10.0-12-2-amd64
Build commit: 7c746e67d
Build date: Thu Nov 10 18:01:32 UTC 2022
Built by: AzDevOps@sonic-build-workers-002D7H

Platform: x86_64-accton_as9516_32d-r0
HwSKU: newport
ASIC: barefoot
ASIC Count: 1
**Attach debug file `sudo generate_dump`:**

```
(paste your output here)
```
@azure-pipelines-wrapper
Copy link

Thanks for opening this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant