question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

python: configuration field for LRO polling interval is not correct

See original GitHub issue

The generated code for client assumes long_running_operation_retry_timeout, but its operation assumes long_running_operation_timeout

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
annatischcommented, Nov 2, 2016

Hi @yugangw-msft, thanks for spotting this!

After discussing possible fixes with @lmazuel, we’re thinking that we will remove this (and other options) from the constructor of the client, so these will need to be set specifically on client.config like you are currently doing in your workaround.

This should help us reduce the size of the generated code.

For example, the generated code will become:

class ComputeManagementClientConfiguration(AzureConfiguration):
    def __init__(self, credentials, subscription_id, base_url=None, filepath=None):

        if credentials is None:
            raise ValueError("Parameter 'credentials' must not be None.")
        if subscription_id is None:
            raise ValueError("Parameter 'subscription_id' must not be None.")
        if not isinstance(subscription_id, str):
            raise TypeError("Parameter 'subscription_id' must be str.")
        if not base_url:
            base_url = 'https://management.azure.com'

        super(ComputeManagementClientConfiguration, self).__init__(base_url, filepath)

        self.add_user_agent('computemanagementclient/{}'.format(VERSION))
        self.add_user_agent('Azure-SDK-For-Python')

        self.credentials = credentials
        self.subscription_id = subscription_id

class ComputeManagementClient(object):
    def __init__(self, credentials, subscription_id, base_url=None, filepath=None):

        self.config = ComputeManagementClientConfiguration(credentials, subscription_id, base_url, filepath)
        self._client = ServiceClient(self.config.credentials, self.config)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)

And this would be consumed and configured like so:

client = ComputeManagementClient(creds, sub_id, base_url=service_url)
client.config.generate_request_id = False  # Default is True
client.config.accept_language = 'de-DE'  # Default is 'en-US'
client.config.long_running_operation_timeout = 5  # Default is 30

This is a breaking change - so will be rolled out into the next major version of the Azure SDK for Python.

What do you think?

Cheers, Anna

0reactions
lmazuelcommented, Jul 17, 2017

@fearthecowboy indeed already fixed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Doc of how to adjust op status polling interval #1120 - GitHub
Is there a document and example showing how to control the interval at which Azure Python SDK polls operations for completion?
Read more >
Set Polling Interval on Python Openzwave - Stack Overflow
1 Answer 1 ... [if] set to true (via SetPollInterval), the pollInterval will be interspersed between each poll (so a much smaller m_pollInterval...
Read more >
Polling interval multiplier - GitLab Docs
Configure. To adjust the polling interval multiplier: On the top bar, select Main menu > Admin. On the left sidebar, select Settings ......
Read more >
python-can.pdf - Read the Docs
python -can runs any where Python runs; from high powered computers with commercial CAN to USB devices right down to low powered devices...
Read more >
REST API Modular Input - Polling Interval is not working
Hello Everyone, I try to use the REST Api Input in my splunk account but i have an issue. The "Polling Interval" value...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found