Comment 1 for bug 1492468

Revision history for this message
Ben Howard (darkmuggle-deactivatedaccount) wrote : Re: ConfigDrive fails to provision when network interface key is "interfaces"

Simple fix:

--- cloud-init-0.6.3.orig/cloudinit/DataSourceConfigDrive.py
+++ cloud-init-0.6.3/cloudinit/DataSourceConfigDrive.py
@@ -198,8 +198,14 @@
             LOG.debug("Updating network interfaces from config drive (%s)",
                       dsmode)

- util.write_file("/etc/network/interfaces",
- md['network-interfaces'])
+ # Look at network-interfaces first and then use interfaces
+ # to support OpenNimbula clouds.
+ for iname in ("network-interfaces", "interfaces"):
+ iface_def = md.get(iname, None)
+ if iface_def is not None:
+ util.write_file("/etc/network/interfaces", iface_def)
+ break
+
             try:
                 (out, err) = util.subp(['ifup', '--all'])
                 if len(out) or len(err):