diff options
| author | Chad Smith <chad.smith@canonical.com> | 2018-07-09 15:34:51 -0600 |
|---|---|---|
| committer | Chad Smith <chad.smith@canonical.com> | 2018-07-09 15:34:51 -0600 |
| commit | 92002fb7a2f41314d6aba74646644e5fdd5c39a0 (patch) | |
| tree | 05a6aedccd30b88a80d8f8f1187b75c9bb6444c6 /cloudinit/stages.py | |
| parent | bea500a37d64ef62ecd7edb8c6cb4634336ad60c (diff) | |
| parent | 2e62cb8a6406309cbeb5f8d2aa00fb30e72e1cfc (diff) | |
| download | vyos-cloud-init-92002fb7a2f41314d6aba74646644e5fdd5c39a0.tar.gz vyos-cloud-init-92002fb7a2f41314d6aba74646644e5fdd5c39a0.zip | |
merge from master at 18.3-9-g2e62cb8a
Diffstat (limited to 'cloudinit/stages.py')
| -rw-r--r-- | cloudinit/stages.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/cloudinit/stages.py b/cloudinit/stages.py index 286607bf..c132b57d 100644 --- a/cloudinit/stages.py +++ b/cloudinit/stages.py @@ -22,6 +22,8 @@ from cloudinit.handlers import cloud_config as cc_part from cloudinit.handlers import shell_script as ss_part from cloudinit.handlers import upstart_job as up_part +from cloudinit.event import EventType + from cloudinit import cloud from cloudinit import config from cloudinit import distros @@ -648,10 +650,14 @@ class Init(object): except Exception as e: LOG.warning("Failed to rename devices: %s", e) - if (self.datasource is not NULL_DATA_SOURCE and - not self.is_new_instance()): - LOG.debug("not a new instance. network config is not applied.") - return + if self.datasource is not NULL_DATA_SOURCE: + if not self.is_new_instance(): + if not self.datasource.update_metadata([EventType.BOOT]): + LOG.debug( + "No network config applied. Neither a new instance" + " nor datasource network update on '%s' event", + EventType.BOOT) + return LOG.info("Applying network configuration from %s bringup=%s: %s", src, bring_up, netcfg) |
