sonic-utilities icon indicating copy to clipboard operation
sonic-utilities copied to clipboard

[config db] Trim garbage charactor in "DEVICE_METADATA" of config db

Open wenyiz2021 opened this issue 8 months ago • 1 comments

This is to prevent a user error in ADO: 28004860 where there was an extra "\n" at the end of mac, in "DEVICE_METADATA" section.

image

What I did

  1. the garbage char could be generated with "load_minigraph" if '-override-config' is specified, and if golden_config has garbage char.
  2. it could also be introduced by "config reload"

How I did it

in both cases, add the strip method for "mac" as well as "platform" whenever the DEVICE_METADATA tends to be modified. to trim the extra "\n"

How to verify it

  1. add an extra "\n" at end of mac, in config db
  2. did config reload, garbage char exists
  3. apply changes in this PR

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

wenyiz2021 avatar May 29 '24 22:05 wenyiz2021