Whamcloud - gitweb
LU-17479 utils: Update lnet tools to support PyYAML format 45/53845/3
authorJames Simmons <jsimmons@infradead.org>
Mon, 29 Jan 2024 00:45:40 +0000 (19:45 -0500)
committerOleg Drokin <green@whamcloud.com>
Thu, 15 Feb 2024 06:59:28 +0000 (06:59 +0000)
commit9856b5e19dac4913f1b369bfce1a891a6263a0fb
treefa660acdba1639be0965fe0cb94960edea873aff
parentf4e23a6549ce7fd18b8f278808bfc4ab9085b8d8
LU-17479 utils: Update lnet tools to support PyYAML format

The current cYAML implementation can't handle PyYAML indentation
style. The reason is the underlying libyaml library creates
different yaml events / tokens for the PyYAML format. I attempted
to inject the missing yaml tokens from the PyYAML format but that
failed to work. Also the tokens with the PyYAML produced the
wrong scalar strings. I looked at moving to yaml events instead
of tokens but that required a large change. The simplest change
was to capture the YAML config input and place it into a locally
allocated buffer. Then alter the location of '-' which changed
the YAML config from PyYAML to something cYAML can handle. For
this to work I needed to move the YAML config data handling out
of cYAML_build_tree() to jt_import(). The reason was that
lustre_yaml_cb_helper() is called more than once and for stdin
it can only be read once.

Test-Parameters: trivial testlist=sanity-lnet
Change-Id: Ic8529ae264c9cbe6872da9a9e3421db78f8ea371
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53845
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Frank Sehr <fsehr@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/utils/lnetconfig/liblnetconfig.c
lnet/utils/lnetconfig/liblnetconfig.h
lnet/utils/lnetctl.c