Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-76267

Misleading line and column indication when bond port format is invalid

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • None
    • rhel-9.6
    • nmstate
    • No
    • Low
    • 1
    • rhel-net-mgmt
    • ssg_networking
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • NMT SST - Refine next
    • Hide

      Definition of Done:

      Please mark each item below with ( / ) if completed or ( x ) if incomplete:

      ( ) The acceptance criteria defined below are met.

      Given a YAML configuration with a bond port field in the wrong format (e.g., a map instead of a string),

      When the system administrator runs nmstatectl apply <filename>,

      Then, nmstate should display an error message that accurately indicates the invalid field and a precise line or schema location. 

      Definition of Done:

      • The implementation meets the acceptance criteria
      • Integration tests are written and pass 
      • The fix is part of a downstream build attached to an errata

      ( ) Code changes are included in a downstream build attached to an errata.


      ( ) All required testing (manual and/or automated) passes successfully.


      ( ) Related documentation updates (if applicable) have been completed.

      Show
      Definition of Done: Please mark each item below with ( / ) if completed or ( x ) if incomplete: ( ) The acceptance criteria defined below are met. Given a YAML configuration with a bond port field in the wrong format (e.g., a map instead of a string), When the system administrator runs nmstatectl apply <filename>, Then, nmstate should display an error message that accurately indicates the invalid field and a precise line or schema location.  Definition of Done: The implementation meets the acceptance criteria Integration tests are written and pass  The fix is part of a downstream build attached to an errata ( ) Code changes are included in a downstream build attached to an errata. ( ) All required testing (manual and/or automated) passes successfully. ( ) Related documentation updates (if applicable) have been completed.
    • None
    • None
    • None

      What were you trying to do that didn't work?

      Use wrong format in bond port, nmstate provides wrong error position.

      What is the impact of this issue to you?

      It is misleading for locating the error position.

      Please provide the package NVR for which the bug is seen:

      nmstate-2.2.38-1.el9.x86_64

      How reproducible is this bug?:

      100%

      Steps to reproduce

       

      cat << EOF > wrong-format.yaml
      interfaces:
      - name: bond0
        type: bond
        state: up
        link-aggregation:
          mode: 0
          port:
          - name: veth0
          - name: veth1
      EOF
      nmstatectl apply wrong-format.yaml
      

       

      Expected results

      (An example)
      Invalid format in bond port, should be a string (interface name), not a map

      Or refer to:

      Similarly, when applying

      interfaces:
      - name: br0
        type: linux-bridge
        state: up
        bridge:
          port:
            - veth1
      

      nmstate prompts:

      Provide file is not valid NetworkState or NetworkPolicy: interfaces: invalid type: string "veth1", expected struct LinuxBridgePortConfig at line 2 column 1

      Though "line 2 column 1" is incorrect, the other information is clear enough.

      Actual results

      Provide file is not valid NetworkState or NetworkPolicy: interfaces: invalid type: map, expected a string at line 2 column 1

      The position seems relative to `port`, but lack of other info may mislead user to check line 2 column 1 in the YAML file

       

              rh-ee-sfaye Stanislas Faye
              rh-ee-mshi1 Mingyu Shi
              Network Management Team Network Management Team
              Mingyu Shi Mingyu Shi
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: