Skip to content

Dev: ra: Show parameters more clearly #1733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

liangxin1300
Copy link
Collaborator

@liangxin1300 liangxin1300 commented Mar 28, 2025

Changes for ra info output

  • Show ra name in headers
# new
ocf:heartbeat:IPaddr2 - Manages virtual IPv4 and IPv6 addresses (Linux specific version)
# original
Manages virtual IPv4 and IPv6 addresses (Linux specific version) (ocf:heartbeat:IPaddr2)
# new
debug (deprecated) (string): Write debug information to given file
# original
debug (string): Write debug information to given file
# new
ip* (obsoletes: ipaddr) (string): IP address or hostname of fencing device
# original
ip* (string): IP address or hostname of fencing device
  • Don't show parameter as required, which deprecated
# new
ip* (obsoletes: ipaddr) (string): IP address or hostname of fencing device
ipaddr (deprecated) (string): IP address or hostname of fencing device
username* (obsoletes: login) (string): Login name
login (deprecated) (string): Login name
# original
ip* (string): IP address or hostname of fencing device
ipaddr* (string): IP address or hostname of fencing device
username* (string): Login name
login* (string): Login name
  • Show short description for FA
# new
stonith:fence_ifmib - Fence agent for IF MIB
# original
stonith:fence_ifmib
  • Show required parameters first, then others in alphabetical order, at last, show those deprecated parameters

@liangxin1300 liangxin1300 force-pushed the 20250328_show_parameters_more_clear branch 6 times, most recently from 660de42 to 3f71944 Compare April 2, 2025 07:34
@liangxin1300 liangxin1300 changed the title Dev: ra: Show parameters more clear Dev: ra: Show parameters more clearly Apr 2, 2025
@liangxin1300 liangxin1300 force-pushed the 20250328_show_parameters_more_clear branch from 3f71944 to 3a07161 Compare April 2, 2025 08:03
@liangxin1300 liangxin1300 marked this pull request as ready for review April 2, 2025 08:04
@liangxin1300 liangxin1300 force-pushed the 20250328_show_parameters_more_clear branch from 3a07161 to ea50b94 Compare April 2, 2025 08:10
@nicholasyang2022
Copy link
Collaborator

Too noisy. The original format, using * to denote required parameters is more readable.

@liangxin1300
Copy link
Collaborator Author

Too noisy. The original format, using * to denote required parameters is more readable.

I thought this could be unified with the format like *** Advanced Use Only *** and *** Automatically generated by pacemaker ***

@liangxin1300
Copy link
Collaborator Author

This PR also fix #1724

# crm_resource --show-metadata stonith:fence_virsh|grep "required=\"1\""|grep -v deprecated
    <parameter name="ip" unique="0" required="1" obsoletes="ipaddr">
    <parameter name="username" unique="0" required="1" obsoletes="login">
crm(live/alp-1)configure# primitive st_virsh fence_virsh
crm(live/alp-1)configure# commit
(unpack_config)         warning: Blind faith: not fencing unseen nodes
ERROR: st_virsh: required parameter "ip" not defined
ERROR: st_virsh: required parameter "username" not defined
Do you still want to commit  (y/n)?

@nicholasyang2022
Copy link
Collaborator

I thought this could be unified with the format like *** Advanced Use Only *** and *** Automatically generated by pacemaker ***

Apparently, required fields does not need such strong user attention compared to advanced use only fields. And deprecated/obsoleted fields should attract less user attention than other fields.

@liangxin1300
Copy link
Collaborator Author

And deprecated/obsoleted fields should attract less user attention than other fields.

Then how to mark them?

@nicholasyang2022
Copy link
Collaborator

nicholasyang2022 commented Apr 8, 2025

And deprecated/obsoleted fields should attract less user attention than other fields.

Then how to mark them?

We can sort the parameters, displaying required ones first, and then other common parameters, and lastly deprecated ones. And it is enough to use (deprecated) to mark them.

Or we can display deprecated parameters in a separated section after other parameters, so that users can ignore the entire section when they don't need them.

@liangxin1300 liangxin1300 force-pushed the 20250328_show_parameters_more_clear branch from 9a4ffd7 to f687812 Compare April 9, 2025 06:27
@liangxin1300
Copy link
Collaborator Author

We can sort the parameters, displaying required ones first, and then other common parameters, and lastly deprecated ones. And it is enough to use (deprecated) to mark them.

Changed

- Sort parameters by required parameters first, then by alphabetical
  order, at least for the deprecated parameters
- Change the way to show required/deprecated/obsolete parameters
@liangxin1300 liangxin1300 force-pushed the 20250328_show_parameters_more_clear branch from f687812 to ae19e32 Compare April 24, 2025 06:36
Copy link
Collaborator

@nicholasyang2022 nicholasyang2022 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested. LGTM.

liangxin1300 added a commit that referenced this pull request Apr 27, 2025
backport #1733 
The extra code lines are for the test case output of external/ssh, which
is dropped on the master branch
@liangxin1300 liangxin1300 merged commit 5699e1d into ClusterLabs:master Apr 27, 2025
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants