Whamcloud - gitweb
LU-17205 utils: add lctl get_param -H option 30/52730/6
authorAurelien Degremont <adegremont@nvidia.com>
Tue, 17 Oct 2023 13:07:45 +0000 (15:07 +0200)
committerOleg Drokin <green@whamcloud.com>
Wed, 8 Nov 2023 22:05:36 +0000 (22:05 +0000)
commita12c352a3dd8d424b1da09efc6884530c60d105b
tree3b8e3fb4601e99f318414bdf346645c1cd80db92
parent8fa3532b1ee887be378adbf9432707b2d8a2d814
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.

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