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

Add transport args as a kwarg for HubProxy [RHELDST-27818] #268

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

amcmahon-rh
Copy link
Contributor

We would like to be able to set the retry parameters for xml-rpc calls in pub. The retry_request decorator accepts kwargs for setting the retry parameters, but the HubProxy class doesn't make use of these.

This change allows users to provide transport class args as a kwarg, so we can modify the retry behaviour.

@@ -129,7 +129,8 @@ class ClientCommand(kobo.cli.Command):
class HubProxy(object):
"""A Hub client (thin ServerProxy wrapper)."""

def __init__(self, conf, client_type=None, logger=None, transport=None, auto_logout=None, **kwargs):
def __init__(self, conf, client_type=None, logger=None, auto_logout=None,
Copy link
Member

Choose a reason for hiding this comment

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

This change reorders some positional arguments. That's backwards-incompatible, can you please avoid that?

For example, if someone has written:

proxy = HubProxy(conf, "worker", logger, None, True)

Prior to this change, that True meant auto_logout=True.
When they upgrade to the kobo version with this change, it will instead mean transport=True and their code will crash.

We might hope that everyone has only used named arguments here, but it's not something we can assume.

We would like to be able to set the retry parameters for xml-rpc calls
in pub. The retry_request decorator accepts kwargs for setting the retry
parameters, but the HubProxy class doesn't make use of these.

This change allows users to provide transport class args as a kwarg, so
we can modify the retry behaviour.
@rohanpm rohanpm self-requested a review November 25, 2024 00:01
@rohanpm rohanpm merged commit 0568cce into release-engineering:master Nov 25, 2024
19 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