summaryrefslogtreecommitdiff
path: root/cloudinit/sources
diff options
context:
space:
mode:
authorJames Falcon <therealfalcon@gmail.com>2021-09-17 16:25:22 -0500
committerGitHub <noreply@github.com>2021-09-17 16:25:22 -0500
commitdc22786980a05129c5971e68ae37b1a9f76f882d (patch)
tree6c1e1438b6ce26574769b18f289752324bfc4189 /cloudinit/sources
parent612e39087aee3b1242765e7c4f463f54a6ebd723 (diff)
downloadvyos-cloud-init-dc22786980a05129c5971e68ae37b1a9f76f882d.tar.gz
vyos-cloud-init-dc22786980a05129c5971e68ae37b1a9f76f882d.zip
Set Azure to apply networking config every BOOT (#1023)
In #1006, we set Azure to apply networking config every BOOT_NEW_INSTANCE because the BOOT_LEGACY option was causing problems applying networking the second time per boot. However, BOOT_NEW_INSTANCE is also wrong as Azure needs to apply networking once per boot, during init-local phase.
Diffstat (limited to 'cloudinit/sources')
-rwxr-xr-xcloudinit/sources/DataSourceAzure.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/cloudinit/sources/DataSourceAzure.py b/cloudinit/sources/DataSourceAzure.py
index 3fb564c8..f8641dfd 100755
--- a/cloudinit/sources/DataSourceAzure.py
+++ b/cloudinit/sources/DataSourceAzure.py
@@ -22,7 +22,7 @@ import requests
from cloudinit import dmi
from cloudinit import log as logging
from cloudinit import net
-from cloudinit.event import EventType
+from cloudinit.event import EventScope, EventType
from cloudinit.net import device_driver
from cloudinit.net.dhcp import EphemeralDHCPv4
from cloudinit import sources
@@ -339,6 +339,10 @@ def temporary_hostname(temp_hostname, cfg, hostname_command='hostname'):
class DataSourceAzure(sources.DataSource):
dsname = 'Azure'
+ default_update_events = {EventScope.NETWORK: {
+ EventType.BOOT_NEW_INSTANCE,
+ EventType.BOOT,
+ }}
_negotiated = False
_metadata_imds = sources.UNSET
_ci_pkl_version = 1