-
Notifications
You must be signed in to change notification settings - Fork 180
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
Add spacecmd function: cryptokey_update #6544
Conversation
Oh well, the bot is the same opinion, this is too much duplication... |
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.
Thank you very much for the PR.
Maybe what you could do to reduce code duplicaton is writing the common code between do_cryptokey_create
and do_cryptokey_create
in a separate function. In that way you would have one call to this common function followed by a call to self.client.kickstart.keys.create
or self.client.kickstart.keys.update
.
Oops, there was a typo on the previous message. I think what @ycedres meant here is that you could refactor common code between @blu-base any chance to make these changes? Thanks in advance! |
I was having trouble setting up a test environment with sumaform. I lacked training in terraform, so it was time-consuming to figure out my configuration issues. Leave me a few days to improve this pr. |
73fc7ba
to
48d23b6
Compare
48d23b6
to
f9730a0
Compare
Adding the private function `_crypto_key_options` in spacecmd's cryptokey module to minimize code duplication in the previously introduced `do_cryptokey_update` function
f9730a0
to
6a685c1
Compare
This should be ready for another look. |
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 for the changes. LGTM!
What does this PR change?
spacecmd
has function for most API calls for managing SSL/GPG keys, such as creating and deleting. There also is an API call to update keys. However, the function to update a key is missing inspacecmd
.This PR adds the function
cryptokey_update
to update SSL/GPG keys in the same way as creating them viaspacecmd
.Discussion point:
This mostly duplicates code present in the
cryptokey_create
function, respectively the methoddo_cryptokey_create
in/spacecmd/src/spacecmd/cryptokey.py
and its test. It might be advantageous to extract the common logic between the create, and update function. Would you suggest further such work?GUI diff
No difference.
Documentation
Doc strings for new python functions
Documentation issue was created: Pending
DONE
Test coverage
Unit tests were added
DONE
Links
Changelogs
spacecmd.changes: - Add spacecmd function: cryptokey_update
Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository
If you don't need a changelog check, please mark this checkbox:
If you uncheck the checkbox after the PR is created, you will need to re-run
changelog_test
(see below)Re-run a test
If you need to re-run a test, please mark the related checkbox, it will be unchecked automatically once it has re-run: