Whamcloud - gitweb
LU-17205 utils: add lctl get_param -H option
authorAurelien Degremont <adegremont@nvidia.com>
Tue, 17 Oct 2023 13:07:45 +0000 (15:07 +0200)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 10 Nov 2023 09:33:04 +0000 (09:33 +0000)
commit84f02085b9678625f9e7476a537d1ae4e7720a54
tree004ae2987a66728a9bb87ede77056eac2a7aed48
parent46468f5a75fdf45a5b936c628f5a141fff6ffa08
LU-17205 utils: add lctl get_param -H option

- Add a new '-H' option to 'lctl get_param' that will prefix
each output line with the parameter name instead of only
the first line by default.

That makes grepping lctl get_param with wildcards much easier
as you can now easily know which parameter returns which value.

  $ lctl get_param -H osc.*.state | grep current
  osc.lustre-OST0000-osc-ff1148c0.state=current_state: FULL
  osc.lustre-OST0001-osc-ff1248c0.state=current_state: DISCONN
  osc.lustre-OST0002-osc-ff1348c0.state=current_state: FULL
  osc.lustre-OST0003-osc-ff1448c0.state=current_state: FULL
  osc.lustre-OST0004-osc-ff1548c0.state=current_state: FULL

It also prints an output line even for empty values. That also
makes like easier for admins.

- The patch also removes the force line feed if the parameter
value was larger than 80 chars. This was considered a misfeature
and is now drop for all usages, with or without -H.

Lustre-change: https://review.whamcloud.com/52730
Lustre-commit: a12c352a3dd8d424b1da09efc6884530c60d105b

Test-Parameters: trivial
Signed-off-by: Aurelien Degremont <adegremont@nvidia.com>
Change-Id: Ib1fa0dc400db4c19fed10ad4cced9be5668418e3
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53067
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/doc/lctl-get_param.8
lustre/utils/lctl.c
lustre/utils/lustre_cfg.c