Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-15174

lctl llog_print emits invalid YAML

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      lctl llog_print emits invalid YAML. Strings are not quoted or escaped properly.

      An unquoted YAML string scalar cannot begin with '*'. See https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html .

      # lctl --device MGS llog_print params 
      - { index: 2, event: set_param, device: general, parameter: *.*.lbug_on_grant_miscount, value: 1 }
      - { index: 5, event: set_param, device: general, parameter: obdfilter.*.access_log_size, value: 1048576 }
      # lctl --device MGS llog_print params | yq .
      yq: Error running jq: ScannerError: while scanning an alias
        in "<stdin>", line 1, column 61
      expected alphabetic or numeric character, but found '.'
        in "<stdin>", line 1, column 62.
      
      # lctl set_param -P -d '*.*.lbug_on_grant_miscount'
      # lctl --device MGS llog_print params 
      - { index: 5, event: set_param, device: general, parameter: obdfilter.*.access_log_size, value: 1048576 }
      # lctl --device MGS llog_print params | yq .
      [
        {
          "index": 5,
          "event": "set_param",
          "device": "general",
          "parameter": "obdfilter.*.access_log_size",
          "value": 1048576
        }
      ]
      

      This makes it impossible to parse the output of lctl llog_print using standard YAML parsers. Like yq.

      Attachments

        Activity

          People

            wc-triage WC Triage
            jhammond John Hammond
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: