]> git.siccegge.de Git - forks/vmdebootstrap.git/commitdiff
Specific support for wheezy networking.
authorNeil Williams <codehelp@debian.org>
Sat, 4 Jul 2015 08:50:37 +0000 (09:50 +0100)
committerNeil Williams <codehelp@debian.org>
Sat, 4 Jul 2015 08:50:37 +0000 (09:50 +0100)
vmdebootstrap

index 4895147457cb7ee06fddc42281b5bd9af5d66e6c..2e7f9e93264fff3930adf63c8b0eb33eaf60a601 100755 (executable)
@@ -624,7 +624,14 @@ class VmDebootstrap(cliapp.Application):  # pylint: disable=too-many-public-meth
     def setup_networking(self, rootdir):
         self.message('Setting up networking')
 
-        if not os.path.exists(os.path.join(rootdir, 'etc', 'network', 'interfaces')):
+        # unconditionally write for wheezy (which became oldstable on 04/25/2015)
+        if self.was_oldstable(datetime.date(2015, 4, 26)):
+            with open(os.path.join(
+                rootdir, 'etc', 'network', 'interfaces'), 'w') as netfile:
+                netfile.write('source /etc/network/interfaces.d/*\n')
+            os.mkdir(os.path.join(rootdir, 'etc', 'network', 'interfaces.d'))
+
+        elif not os.path.exists(os.path.join(rootdir, 'etc', 'network', 'interfaces')):
             with open(os.path.join(
                 rootdir, 'etc', 'network', 'interfaces'), 'w') as netfile:
                 netfile.write('source-directory /etc/network/interfaces.d\n')