ponymail-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject [1/5] incubator-ponymail git commit: add db prefix option for setup
Date Mon, 30 Oct 2017 15:13:43 GMT
Repository: incubator-ponymail
Updated Branches:
  refs/heads/master 78adae380 -> fb78e1bcb


add db prefix option for setup


Project: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/commit/532a38d1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/tree/532a38d1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ponymail/diff/532a38d1

Branch: refs/heads/master
Commit: 532a38d1f40875bc9bb5761ed9e65ee270e58569
Parents: 78adae3
Author: Daniel Gruno <humbedooh@apache.org>
Authored: Mon Oct 30 16:10:51 2017 +0100
Committer: Daniel Gruno <humbedooh@apache.org>
Committed: Mon Oct 30 16:10:51 2017 +0100

----------------------------------------------------------------------
 tools/setup.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ponymail/blob/532a38d1/tools/setup.py
----------------------------------------------------------------------
diff --git a/tools/setup.py b/tools/setup.py
index c5abab8..9b85014 100755
--- a/tools/setup.py
+++ b/tools/setup.py
@@ -56,7 +56,7 @@ parser = argparse.ArgumentParser(description='Command line options.')
 
 parser.add_argument('--defaults', dest='defaults', action='store_true', 
                    help='Use default settings')
-
+parser.add_argument('--dbprefix', dest='dbprefix')
 parser.add_argument('--clobber', dest='clobber', action='store_true',
                    help='Allow overwrite of ponymail.cfg & ../site/api/lib/config.lua
(default: create *.tmp if either exists)')
 parser.add_argument('--dbhost', dest='dbhost', type=str, nargs=1,
@@ -100,7 +100,7 @@ genname = ""
 wce = False
 shards = 0
 replicas = -1
-
+up = None
 
 # If called with --defaults (like from Docker), use default values
 if args.defaults:
@@ -116,6 +116,8 @@ if args.defaults:
     genname = "cluster"
 
 # Accept CLI args, copy them
+if args.dbprefix:
+    up = args.dbprefix
 if args.dbhost:
     hostname = args.dbhost[0]
 if args.dbport:
@@ -139,6 +141,9 @@ if args.generator:
     
 while hostname == "":
     hostname = input("What is the hostname of the ElasticSearch server? (e.g. localhost):
")
+
+while up == None:
+    up = input("Database URL prefix if any (hit enter if none): ")
     
 while port < 1:
     try:
@@ -194,7 +199,7 @@ def createIndex():
             'host': hostname,
             'port': port,
             'use_ssl': False,
-            'url_prefix': ''
+            'url_prefix': up
         }],
         max_retries=5,
         retry_on_timeout=True


Mime
View raw message