Added option to create config file or not
authorAnders Henja <anders@henjab.se>
Thu, 5 Jul 2018 20:19:23 +0000 (22:19 +0200)
committerAnders Henja <anders@henjab.se>
Thu, 5 Jul 2018 20:19:23 +0000 (22:19 +0200)
src/baltrad/config/main.py

index 4df8b8c..1b862b2 100644 (file)
@@ -136,7 +136,9 @@ def create_initial_config(args):
 
   a.keystore_jks = args.keystore_jks
   a.keystore_root = args.keys_root
-  a.write_config_file(args.conf)  
+  
+  if args.create_config:
+    a.write_config_file(args.conf)  
 
 def execute_post_config(args):
   a=propertyhandler.propertyhandler()
@@ -206,6 +208,10 @@ def run():
   )
 
   parser_init.add_argument(
+    "--create-config", dest="create_config", action="store_true", help="if the default configuration file should be created",
+  )
+
+  parser_init.add_argument(
     "--keys-root=", dest="keys_root", default="/etc/baltrad/bltnode-keys", help="location of all keys used during exchange"
   )