Skip to content

[Testbed] Filter key-value pairs while retrieving SONiC version from /etc/sonic/sonic_version.yml#7212

Merged
lizhijianrd merged 1 commit intosonic-net:masterfrom
lizhijianrd:fix-fanout-sonic-version
Jan 9, 2023
Merged

[Testbed] Filter key-value pairs while retrieving SONiC version from /etc/sonic/sonic_version.yml#7212
lizhijianrd merged 1 commit intosonic-net:masterfrom
lizhijianrd:fix-fanout-sonic-version

Conversation

@lizhijianrd
Copy link
Contributor

@lizhijianrd lizhijianrd commented Jan 9, 2023

Description of PR

Summary:
The /etc/sonic/sonic_version.yml of SONiC 202205 looks like below:

---
build_version: '202205'
debian_version: '11.6'
kernel_version: '5.10.0-18-2-amd64'
asic_type: broadcom
asic_subtype: 'broadcom'
# ...

There is a --- line at the beginning of file and it causes the ansible playbook crush when deploying SONiC 202205 fanout switches. As we only need the key-value lines, I added grep ":" to filter the key-value lines when reading this file.

Type of change

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

Back port request

  • 201911
  • 202012
  • 202205

Approach

What is the motivation for this PR?

There is a --- line at the beginning of /etc/sonic/sonic_version.yml in SONiC 202205 image, and it causes the ansible playbook crush when deploying fanout switches. I opened this PR to fix this issue.

How did you do it?

Added grep ":" to filter the key-value lines when reading this file.

How did you verify/test it?

Verified on physical testbeds.

Any platform specific information?

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

Documentation

@lizhijianrd lizhijianrd requested a review from Blueve January 9, 2023 04:51
@lizhijianrd lizhijianrd merged commit 6120deb into sonic-net:master Jan 9, 2023
@lizhijianrd lizhijianrd deleted the fix-fanout-sonic-version branch January 9, 2023 07:13
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