Diff comments:

> diff --git a/cloudinit/sources/DataSourceAzure.py 
> b/cloudinit/sources/DataSourceAzure.py
> index 9e8a1a8..2a3e567 100644
> --- a/cloudinit/sources/DataSourceAzure.py
> +++ b/cloudinit/sources/DataSourceAzure.py
> @@ -526,6 +526,13 @@ class DataSourceAzure(sources.DataSource):
>          report_ready = bool(not os.path.isfile(REPORTED_READY_MARKER_FILE))
>          LOG.debug("Start polling IMDS")
>  
> +        def exc_cb(msg, exception):
> +            if isinstance(exception, UrlError) and exception.code == 404:
> +                return True

Ryan I tweaked the unit test to differentiate whether DCHP is called 3 times 
(due to attempt 1 + 2 timeouts) and number of readurl attempts(4), which 
includes the retry on 404. This should capture that we are retrying DHCP vs 
just retrying the url due to 404.

> +            # If we get an exception while trying to call IMDS, we
> +            # call DHCP and setup the ephemeral network to acquire the new 
> IP.
> +            return False
> +
>          while True:
>              try:
>                  # Save our EphemeralDHCPv4 context so we avoid repeated dhcp


-- 
https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/358872
Your team cloud-init commiters is requested to review the proposed merge of 
~chad.smith/cloud-init:bug/1803598-dont-retry-on-timeout-in-imds-poll into 
cloud-init:master.

_______________________________________________
Mailing list: https://launchpad.net/~cloud-init-dev
Post to     : cloud-init-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~cloud-init-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to