diff options
author | aswinrajamannar <39812128+aswinrajamannar@users.noreply.github.com> | 2021-08-24 13:45:41 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-24 15:45:41 -0500 |
commit | 28e56d993fc40feab139f149dacc10cae51a3fe0 (patch) | |
tree | 401c98d7ff9a91645ff8b9f3906252cf3cf525bf /cloudinit | |
parent | 6803368dec44c8b42196931b3a42d014a10b600d (diff) | |
download | vyos-cloud-init-28e56d993fc40feab139f149dacc10cae51a3fe0.tar.gz vyos-cloud-init-28e56d993fc40feab139f149dacc10cae51a3fe0.zip |
Azure: Retry dhcp on timeouts when polling reprovisiondata (#998)
In the nic attach path, we skip doing dhcp since we already did it
when bringing the interface up. However when polling for
reprovisiondata, it is possible for the request to timeout due to
platform issues. In those cases we still need to do dhcp and try again
since we tear down the context. We can only skip the first dhcp
attempt.
Diffstat (limited to 'cloudinit')
-rwxr-xr-x | cloudinit/sources/DataSourceAzure.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py index fddfe363..caffa944 100755 --- a/cloudinit/sources/DataSourceAzure.py +++ b/cloudinit/sources/DataSourceAzure.py @@ -1317,6 +1317,10 @@ class DataSourceAzure(sources.DataSource): except UrlError: # Teardown our EphemeralDHCPv4 context on failure as we retry self._ephemeral_dhcp_ctx.clean_network() + + # Also reset this flag which determines if we should do dhcp + # during retries. + is_ephemeral_ctx_present = False finally: if nl_sock: nl_sock.close() |