Skip to content

[conn_graph] improve graph facts collector#2374

Merged
yxieca merged 1 commit intosonic-net:masterfrom
yxieca:graph
Oct 20, 2020
Merged

[conn_graph] improve graph facts collector#2374
yxieca merged 1 commit intosonic-net:masterfrom
yxieca:graph

Conversation

@yxieca
Copy link
Copy Markdown
Collaborator

@yxieca yxieca commented Oct 20, 2020

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

What is the motivation for this PR?

Nightly test are all failing due to regression in conn_graph_facts.py.

How did you do it?

  • Collect first element of list.
  • Collect full variable for non-list variables.

Signed-off-by: Ying Xie [email protected]

How did you verify/test it?

Run test on physical DUT. Without fix:

    if (res.is_failed or 'exception' in res) and not module_ignore_errors:
      raise RunAnsibleModuleFail("run module {} failed".format(self.module_name), res)

E RunAnsibleModuleFail: run module conn_graph_facts failed, Ansible Results =>
E {
E "changed": false,
E "failed": true,
E "invocation": {
E "module_args": {
E "anchor": null,
E "filename": "/var/src/sonic-mgmt/tests/common/fixtures/../../../ansible/files/starlab_connection_graph.xml",
E "filepath": null,
E "host": "str-dx010-acs-1",
E "hosts": null
E }
E },
E "msg": "Traceback (most recent call last):\n File "/tmp/ansible_conn_graph_facts_payload_PAqL5h/main.py", line 348, in main\n results = {k: v[0] for k, v in results.items()}\n File "/tmp/ansible_conn_graph_facts_payload_PAqL5h/main.py", line 348, in \n results = {k: v[0] for k, v in results.items()}\nKeyError: 0\n"
E }

With the fix, test passes.

- Collect first element of list.
- Collect full variable for non-list variables.

Signed-off-by: Ying Xie <[email protected]>
@yxieca yxieca requested review from a team and lolyu October 20, 2020 17:11
@yxieca yxieca merged commit efa1133 into sonic-net:master Oct 20, 2020
@yxieca yxieca deleted the graph branch October 20, 2020 20:16
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
Update sonic-swss submodule pointer to include the following:
* VxLAN Tunnel Counters and Rates implementation (sonic-net#1859) ([sonic-net#2442]
* Fix for "orchagent crashed when trying to delete fdb static entry with swssconfig sonic-net#11046" ([sonic-net#2374]
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 this pull request may close these issues.

2 participants