[LU-15174] lctl llog_print emits invalid YAML Created: 28/Oct/21  Updated: 29/Oct/21

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: John Hammond Assignee: WC Triage
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Related
Severity: 3
Rank (Obsolete): 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.


Generated at Sat Feb 10 03:16:05 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.