summaryrefslogtreecommitdiff
path: root/cloudinit/sources
diff options
context:
space:
mode:
authoraswinrajamannar <39812128+aswinrajamannar@users.noreply.github.com>2021-08-24 13:45:41 -0700
committerGitHub <noreply@github.com>2021-08-24 15:45:41 -0500
commit28e56d993fc40feab139f149dacc10cae51a3fe0 (patch)
tree401c98d7ff9a91645ff8b9f3906252cf3cf525bf /cloudinit/sources
parent6803368dec44c8b42196931b3a42d014a10b600d (diff)
downloadvyos-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/sources')
-rwxr-xr-xcloudinit/sources/DataSourceAzure.py4
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()