Browse Source

Allow switching sources cleanup individually

Sebastian Lohff 2 years ago
parent
commit
f01ed10db7
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      genconfdrv/genconfdrv.py

+ 6
- 2
genconfdrv/genconfdrv.py View File

@@ -281,6 +281,7 @@ def main():
281 281
     parser.add_argument("-u", "--disable-upgrades", action="store_true", default=False)
282 282
     parser.add_argument("-v", "--verbose", action="store_true", default=False)
283 283
     parser.add_argument("--no-debian-cleanup", "--ndc", action="store_true", default=False)
284
+    parser.add_argument("--no-debian-sources-cleanup", "--ndsc", action="store_true", default=False)
284 285
     parser.add_argument("--no-remove-cloud-init", action="store_true", default=False,
285 286
                         help="Do not purge cloud-init from system after execution")
286 287
     parser.add_argument("--set-root-password", "--srp", default=None)
@@ -318,10 +319,13 @@ def main():
318 319
 
319 320
         if not args.no_debian_cleanup:
320 321
             cfgdrv.add_command("rm -f /etc/network/interfaces.d/eth*", True)
321
-            cfgdrv.add_command("sed -rni '/^([^#]|## template)/p' /etc/cloud/templates/sources.list.*.tmpl; "
322
-                               "rm /etc/apt/sources.list.d/*", True)
322
+            cfgdrv.add_command("sed -rni '/^([^#]|## template)/p' /etc/cloud/templates/sources.list.*.tmpl", True)
323 323
             cfgdrv.add_command("sed -rni '/^([^#]|## template)/p' "
324 324
                                "/etc/resolv.conf /etc/cloud/templates/resolv.conf.tmpl", True)
325
+
326
+        if not args.no_debian_sources_cleanup:
327
+            cfgdrv.add_command("rm /etc/apt/sources.list.d/*", True)
328
+
325 329
         if args.set_root_password:
326 330
             cfgdrv.set_password("root", args.set_root_password)
327 331
 

Loading…
Cancel
Save