feat: Add methods to manage autosign entries for puppet/openvox on a SmartProxy - #1376
Merged
Merged
Conversation
There was a problem hiding this comment.
Hey there - I've reviewed your changes - here's some feedback:
- The docstring in test_delete_autosign_entry still references add_autosign_entry—please update it to mention delete_autosign_entry instead.
- add_autosign_entry and delete_autosign_entry share similar setup for kwargs and path construction; consider extracting that into a common helper to reduce duplication.
- It might be helpful to add a test that patches _handle_response (or asserts on its return) to verify these methods correctly propagate the server response.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The docstring in test_delete_autosign_entry still references add_autosign_entry—please update it to mention delete_autosign_entry instead.
- add_autosign_entry and delete_autosign_entry share similar setup for kwargs and path construction; consider extracting that into a common helper to reduce duplication.
- It might be helpful to add a test that patches _handle_response (or asserts on its return) to verify these methods correctly propagate the server response.
## Individual Comments
### Comment 1
<location> `nailgun/entities.py:8087-8082` </location>
<code_context>
+ self._server_config,
+ )
+
+ def delete_autosign_entry(self, certname, **kwargs):
+ """Delete an entry from the puppetserver's autosign file.
+
+ :param certname: Name of the host to be deleted from the autosign file
+ """
+ kwargs = kwargs.copy()
+ kwargs.update(self._server_config.get_client_kwargs())
+ path = f'{self.path()}/autosign/{certname}'
+ return _handle_response(
+ client.delete(path, **kwargs),
+ self._server_config,
</code_context>
<issue_to_address>
**suggestion:** Check for edge cases with certname in URL path construction.
URL-encode certname or validate its format to prevent issues with special characters or slashes in the path.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
|
Can one of the admins verify this patch? |
lpramuk
approved these changes
Nov 13, 2025
ogajduse
approved these changes
Nov 14, 2025
This was referenced Nov 14, 2025
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added two methods to SmartProxy to manage autosign entries on the puppetserver.
The methods allow to add and delete autosign entries.
This is an implementation of https://apidocs.theforeman.org/foreman/3.16/apidoc/v2/autosign.html for POST and DELETE requests.
Example: