Browse Source

Allow networks to be split by both ; and :

Sebastian Lohff 2 years ago
parent
commit
8a1d7e0d46
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      genconfdrv

+ 5
- 2
genconfdrv View File

@@ -244,7 +244,7 @@ def main():
244 244
     parser.add_argument("-H", "--hostname", required=True, help="Hostname")
245 245
     parser.add_argument("-o", "--output", required=True, help="Path to write iso to")
246 246
     parser.add_argument("-n", "--nameservers", "--ns", default=["1.1.1.1", "8.8.8.8"], nargs="+", help="Nameservers")
247
-    parser.add_argument("-i", "--networks", "--net", default=[], nargs="+")
247
+    parser.add_argument("-i", "--networks", "--net", default=[], nargs="+", help="Specify all networks, in format of interface[:address:[gateway]]. Both : and ; can be used as delimiter (but only one per net config). Address MUST be a network in CIDR notation")
248 248
     parser.add_argument("-u", "--disable-upgrades", action="store_true", default=False)
249 249
     parser.add_argument("-v", "--verbose", action="store_true", default=False)
250 250
     parser.add_argument("--no-debian-cleanup", "--ndc", action="store_true", default=False)
@@ -261,7 +261,10 @@ def main():
261 261
         cfgdrv.set_hostname(args.hostname)
262 262
 
263 263
         for net in args.networks:
264
-            net = net.split(":")
264
+            if ";" in net:
265
+                net = net.split(";")
266
+            else:
267
+                net = net.split(":")
265 268
             cfgdrv.conf_network(*net)
266 269
 
267 270
         if args.nameservers:

Loading…
Cancel
Save