Browse Source

Add format argument to argparser and actually use it

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

+ 3
- 1
genconfdrv/genconfdrv.py View File

@@ -273,6 +273,8 @@ def main():
273 273
     parser.add_argument("-a", "--add-user", default=[], nargs="+",
274 274
                         help="Add users, format is username:key?:sudo?:gecos?:password?, "
275 275
                              "sudo is a bool, key is either an ssh key or a path to an ssh key")
276
+    parser.add_argument("-f", "--format", default=None, choices=('tgz', 'iso'),
277
+                        help="Specify output format, default is to infer from output file extension")
276 278
 
277 279
     args = parser.parse_args()
278 280
 
@@ -339,7 +341,7 @@ def main():
339 341
                 cfgdrv.add_user(user[0], keys, sudo=sudo, gecos=gecos, password=password)
340 342
 
341 343
         if args.output:
342
-            cfgdrv.write_iso(args.output)
344
+            cfgdrv.write_drive(args.output, args.format)
343 345
     finally:
344 346
         if cfgdrv:
345 347
             cfgdrv.close()

Loading…
Cancel
Save