-
Notifications
You must be signed in to change notification settings - Fork 547
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
[pacemaker] Replace deprecated "pcs property list" command #3402
Conversation
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There theoretically might be old versions of pcs
deployed (i.e. RHEL8.4 ships 0.10.8
which should have pcs property list
only).
@sbradley7777 , do you know if it could be a problem?
@pmoravec - This will be definitely a problem unless there is some kind of internal check which runs either
|
There are a few options:
I would personally go for 2nd option: just have a check and use appropriate option per it. |
@pmoravec Second option looks good to me too. Let me know if you want me to test anything or if you need a lab to play with. |
666f82f
to
5268466
Compare
Thank you for the review. |
]) | ||
|
||
pcs_version = '.'.join(pcs_pkg['version']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try running sos report -o pcaemaker
on a system without pcs
package installed - you get
TypeError: 'NoneType' object is not subscriptable
here (CI tests fail on this).
One possible solution:
subcmd = 'list'
if pcs_pkg and parse_version('.'.join(pcs_pkg['version'])) > parse_version('0.10.8'):
subcmd = 'config'
self.add_cmd_output(f"pcs property {subcmd}")
(just wrap up the line with if
to 80chars)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again. How about this? I had added a return if the pcs
package does not exist. All commands within the setup_pcs()
depend on the pcs
package, so I believe this should be fine.
Of course, if there are any problems with this, I will make corrections as per your suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry.
flake8 sos
sos/report/plugins/pacemaker.py:48:12: E111 indentation is not a multiple of 4
I will fix this and push it again.
5268466
to
d5a6df7
Compare
Due to the deprecation of the existing "pcs property list", this patch checks the version of pcs and executes "pcs property config" as an alternative." Signed-off-by: Yuki Inoguchi <[email protected]>
d5a6df7
to
8be0322
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What an elegant solution I have overlooked :)
This patch replaces "pcs property list" with "pcs property config" because "pcs property list" is deprecated and will be removed:
This warning message was introduced in pcs v0.10.9:
ClusterLabs/pcs@332f56a#diff-4c58cd856f4e8b23a9d99d961c357e224a9f6314542d50add71a04a2b0b6980cR96-R104
Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines