Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-cloud / recipes-extended / cloud-init / files / first_boot.patch
1 ---
2  cloudinit/sources/DataSourceConfigDrive.py |   13 +++++++------
3  1 file changed, 7 insertions(+), 6 deletions(-)
4
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):
9          self.distro = distro
10  
11 -    def on_first_boot(self, data):
12 +    def on_first_boot(self, data, dsmode="local"):
13          if not data:
14              data = {}
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')
23          if files:
24              LOG.debug("Writing %s injected files", len(files))
25 @@ -214,8 +215,8 @@ class DataSourceConfigDrive(sources.Data
26          # instance-id
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)
33  
34          # dsmode != self.dsmode here if:
35          #  * dsmode = "pass",  pass means it should only copy files and then