diff options
author | Scott Moser <smoser@ubuntu.com> | 2012-02-17 11:00:39 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2012-02-17 11:00:39 -0500 |
commit | 979bee2c9ee477ea495c5df4f420d5ca2123a840 (patch) | |
tree | 16bd6eb874916870293b52197bcd1e34ad1b2265 | |
parent | 45bff1e1c6b1a5a1d9d52e109d38680853c58b11 (diff) | |
download | vyos-cloud-init-979bee2c9ee477ea495c5df4f420d5ca2123a840.tar.gz vyos-cloud-init-979bee2c9ee477ea495c5df4f420d5ca2123a840.zip |
DataSourceConfigDrive: update interfaces (and ifup) only on local
Previously, the 'ifup --all' and update of /etc/network/interfaces
was done only if the specified 'dsmode' (which defaults to 'pass') was
either 'pass' or *this* dsmode.
That meant that it would be updated once on DataSourceConfigDrive
and on DataSourceConfigDriveNet.
This changes that to only happen on local.
-rw-r--r-- | cloudinit/DataSourceConfigDrive.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cloudinit/DataSourceConfigDrive.py b/cloudinit/DataSourceConfigDrive.py index af776e08..f44344a2 100644 --- a/cloudinit/DataSourceConfigDrive.py +++ b/cloudinit/DataSourceConfigDrive.py @@ -72,13 +72,16 @@ class DataSourceConfigDrive(DataSource.DataSource): md = util.mergedict(md, defaults) - if 'interfaces' in md and md['dsmode'] in (self.dsmode, "pass"): + # update interfaces and ifup only on the local datasource + # this way the DataSourceConfigDriveNet doesn't do it also. + if 'network-interfaces' in md and self.dsmode == "local": if md['dsmode'] == "pass": log.info("updating network interfaces from configdrive") else: log.debug("updating network interfaces from configdrive") - util.write_file("/etc/network/interfaces", md['network-interfaces']) + util.write_file("/etc/network/interfaces", + md['network-interfaces']) try: (out, err) = util.subp(['ifup', '--all']) if len(out) or len(err): |