summaryrefslogtreecommitdiff
path: root/cloudinit/stages.py
diff options
context:
space:
mode:
authorRyan Harper <ryan.harper@canonical.com>2017-06-20 17:06:43 -0500
committerScott Moser <smoser@brickies.net>2017-06-27 17:03:34 -0400
commitebc9ecbc8a76bdf511a456fb72339a7eb4c20568 (patch)
tree3b735b43bde5c5d8e96e602f5a7a6c39dd20f34c /cloudinit/stages.py
parent10e5195e4a4459d1893801aa9fb486dc2973415d (diff)
downloadcloud-init-git-ebc9ecbc8a76bdf511a456fb72339a7eb4c20568.tar.gz
Azure: Add network-config, Refactor net layer to handle duplicate macs.
On systems with network devices with duplicate mac addresses, cloud-init will fail to rename the devices according to the specified network configuration. Refactor net layer to search by device driver and device id if available. Azure systems may have duplicate mac addresses by design. Update Azure datasource to run at init-local time and let Azure datasource generate a fallback networking config to handle advanced networking configurations. Lastly, add a 'setup' method to the datasources that is called before userdata/vendordata is processed but after networking is up. That is used here on Azure to interact with the 'fabric'.
Diffstat (limited to 'cloudinit/stages.py')
-rw-r--r--cloudinit/stages.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/cloudinit/stages.py b/cloudinit/stages.py
index ad557827..a1c4a517 100644
--- a/cloudinit/stages.py
+++ b/cloudinit/stages.py
@@ -362,6 +362,11 @@ class Init(object):
self._store_userdata()
self._store_vendordata()
+ def setup_datasource(self):
+ if self.datasource is None:
+ raise RuntimeError("Datasource is None, cannot setup.")
+ self.datasource.setup(is_new_instance=self.is_new_instance())
+
def activate_datasource(self):
if self.datasource is None:
raise RuntimeError("Datasource is None, cannot activate.")