Skip to content
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

Update pcs support for > 0.10 #60257

Merged
merged 59 commits into from Aug 24, 2021
Merged

Update pcs support for > 0.10 #60257

merged 59 commits into from Aug 24, 2021

Conversation

waynegemmell
Copy link
Contributor

@waynegemmell waynegemmell commented May 26, 2021

What does this PR do?

This PR accommodates the cluster auth and setup when using newer version of PCS.

What issues does this PR fix or reference?

Fixes: #56924

Previous Behavior

When authenticating and setting up a cluster the command would fail against pcs < 0.10

New Behavior

Creating and authenticating the cluster is successful.

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

No

@waynegemmell waynegemmell requested a review from a team as a code owner May 26, 2021 10:14
@waynegemmell waynegemmell requested review from Ch3LL and removed request for a team May 26, 2021 10:14
@waynegemmell waynegemmell changed the title Master Update pcs support for > 0.10 May 26, 2021
@garethgreenaway garethgreenaway added the Needs-Testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases label May 26, 2021
salt/modules/pcs.py Outdated Show resolved Hide resolved
salt/modules/pcs.py Outdated Show resolved Hide resolved
salt/modules/pcs.py Outdated Show resolved Hide resolved
Copy link
Member

@s0undt3ch s0undt3ch left a comment

Choose a reason for hiding this comment

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

Now all we need is tests covering your changes....

@waynegemmell
Copy link
Contributor Author

Now all we need is tests covering your changes....

Problem is that there is no existing test on that module/state. If they existed I would have updated them. I don't have any idea about how to do this.

@waynegemmell
Copy link
Contributor Author

@s0undt3ch How do we resolve this? Can we skip the tests or can someone start with the tests and I just add to it?

@Ch3LL
Copy link
Contributor

Ch3LL commented May 28, 2021

I'll write a couple tests for you so you can start form there and I'll push it to your branch. I'm working on them now.

@waynegemmell
Copy link
Contributor Author

@Ch3LL Thank you!

@Ch3LL
Copy link
Contributor

Ch3LL commented May 28, 2021

I pushed some pcs module tests :)

Copy link
Contributor

@Ch3LL Ch3LL left a comment

Choose a reason for hiding this comment

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

Just one more change request from me

@@ -430,8 +444,6 @@ def auth(name, nodes, pcsuser="hacluster", pcspasswd="hacluster", extra_args=Non
return ret
if not isinstance(extra_args, (list, tuple)):
extra_args = []
if "--force" not in extra_args:
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm good with that then, but can we add back the ability to pass in extra_args.

@Ch3LL
Copy link
Contributor

Ch3LL commented Aug 3, 2021

ping @garethgreenaway would you also mind reviewing here as well?

garethgreenaway
garethgreenaway previously approved these changes Aug 3, 2021
@garethgreenaway
Copy link
Contributor

With the change that @Ch3LL requested for extra_args this looks good to me.

Ch3LL
Ch3LL previously approved these changes Aug 4, 2021
@Ch3LL
Copy link
Contributor

Ch3LL commented Aug 4, 2021

just a couple of test failures that need to be cleaned up here and then we can get this merged :)

@waynegemmell
Copy link
Contributor Author

Updated. There is some documentation fail but I can't work out what's going on.

@waynegemmell
Copy link
Contributor Author

Is there anything still outstanding on this?

@Ch3LL
Copy link
Contributor

Ch3LL commented Aug 17, 2021

pre-commit is failing and needs to be cleaned up

@waynegemmell
Copy link
Contributor Author

Looks successful? If not. Please assist. I can't see how to fix any of the transient errors that have popped up.

@Ch3LL Ch3LL merged commit 6f625ff into saltstack:master Aug 24, 2021
@welcome
Copy link

welcome bot commented Aug 24, 2021

Congratulations on your first PR being merged! 🎉

@waynegemmell
Copy link
Contributor Author

waynegemmell commented Aug 26, 2021 via email

dwoz pushed a commit to dwoz/salt that referenced this pull request Sep 12, 2021
* PCS module and state updated to handle pcs version > 0.10

* PCS module and state updated to handle pcs version > 0.10 - changelog

* Removed six

* Module documentation updated

* Requested changes implemented

* Add pcs module tests

* Tests added and is_auth altered to fit purpose

* Tests added. Debian bypass for broken config creation bypassed.

* Tests debug output removed

* Minor linting fixes

* Update salt/modules/pcs.py

Co-authored-by: Megan Wilhite <megan.wilhite@gmail.com>

* Updated as per @Ch3LL's recommendations and other pre-commit fails

* Removed test_config_show and some commented out print lines

* Extra documentation added to cluster_setup

* Updated item_show to work properly with properties and updated tests to match

* Fixed change requests and added a wipe_default flag to remove default config

* Extra args now gets passed from the pcs state to the auth function in the pcs module.

* Minor formatting fix

* Minor build fix to make linter happy

Co-authored-by: Wayne Gemmell <wayne@connect-mobile.co.za>
Co-authored-by: Megan Wilhite <megan.wilhite@gmail.com>
Co-authored-by: Sage the Rage <36676171+sagetherage@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature new functionality including changes to functionality and code refactors, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] PCS module/state broken for Pacemaker 2.x
5 participants