2 cloudinit/sources/DataSourceConfigDrive.py | 13 +++++++------
3 1 file changed, 7 insertions(+), 6 deletions(-)
5 --- a/cloudinit/sources/DataSourceConfigDrive.py
6 +++ b/cloudinit/sources/DataSourceConfigDrive.py
7 @@ -52,12 +52,13 @@ class ConfigDriveHelper(object):
8 def __init__(self, distro):
11 - def on_first_boot(self, data):
12 + def on_first_boot(self, data, dsmode="local"):
15 - if 'network_config' in data:
16 - LOG.debug("Updating network interfaces from config drive")
17 - self.distro.apply_network(data['network_config'])
18 + if dsmode == "local":
19 + if 'network_config' in data:
20 + LOG.debug("Updating network interfaces from config drive")
21 + self.distro.apply_network(data['network_config'])
22 files = data.get('files')
24 LOG.debug("Writing %s injected files", len(files))
25 @@ -214,8 +215,8 @@ class DataSourceConfigDrive(sources.Data
27 prev_iid = get_previous_iid(self.paths)
28 cur_iid = md['instance-id']
29 - if prev_iid != cur_iid and self.dsmode == "local":
30 - self.helper.on_first_boot(results)
31 + if prev_iid != cur_iid:
32 + self.helper.on_first_boot(results, dsmode=self.dsmode)
34 # dsmode != self.dsmode here if:
35 # * dsmode = "pass", pass means it should only copy files and then