Skip to content

Bug: sonic-cfggen returning some boolean values as True and False, breaking YANG validation #22527

Open
sonic-net/sonic-host-services
#252
@bhouse-nexthop

Description

@bhouse-nexthop

Is it platform specific

generic

Importance or Severity

Critical

Description of the bug

YANG mandates that boolean values are true and false, having the first letter be capital as is represented by Python would cause yang validation failures inside of libyang.

sonic-cfggen is sometimes outputting these values as True and False leading to YANG validation failures.

Steps to Reproduce

This can be seen, for instance, when setting:

"MGMT_VRF_CONFIG": {
  "vrf_global": {
    "mgmtVrfEnabled": "true"
  }
}

Then running config save -y. The written value is then "True", if then just running config replace /etc/sonic/config_db.json it would result in an error of:

Invalid value "True" in "mgmtVrfEnabled" element.

Actual Behavior and Expected Behavior

Should be output as "true" instead of "True" when writing the config.

Relevant log output

Output of show version, show techsupport

Attach files (if any)

No response

Implementation

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions