summaryrefslogtreecommitdiff
path: root/cloudinit/distros/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/distros/__init__.py')
-rw-r--r--cloudinit/distros/__init__.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py
index 74b484a7..e32ddd57 100644
--- a/cloudinit/distros/__init__.py
+++ b/cloudinit/distros/__init__.py
@@ -78,6 +78,10 @@ class Distro(object):
def _write_network_config(self, settings):
raise NotImplementedError()
+ @abc.abstractmethod
+ def _write_network_fallback(self):
+ raise NotImplementedError()
+
def _find_tz_file(self, tz):
tz_file = os.path.join(self.tz_zone_dir, str(tz))
if not os.path.isfile(tz_file):
@@ -143,6 +147,14 @@ class Distro(object):
return self._bring_up_interfaces(dev_names)
return False
+ def apply_fallback_network(self, bring_up=True):
+ # Write it out
+ dev_names = self._write_network_fallback()
+ # Now try to bring them up
+ if bring_up:
+ return self._bring_up_interfaces(dev_names)
+ return False
+
@abc.abstractmethod
def apply_locale(self, locale, out_fn=None):
raise NotImplementedError()