Commit e75cc684 authored by Jérome Perrin's avatar Jérome Perrin

make host, port and portal_name some parameter, so that we can run tests behind

a web frontend


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20735 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cd8317fd
...@@ -22,6 +22,11 @@ Options: ...@@ -22,6 +22,11 @@ Options:
-s, --stdout prints the results on stdout instead of sending -s, --stdout prints the results on stdout instead of sending
results by email (unless email_to_address is also results by email (unless email_to_address is also
passed explictly) passed explictly)
--host the hostname of this ERP5 instance
--port the port of this ERP5 instance
--portal_name the ID of the ERP5 site
URLs will start with:
http://${host}:${port}/${portal_name}/
""" """
...@@ -60,10 +65,13 @@ def parseArgs(): ...@@ -60,10 +65,13 @@ def parseArgs():
global send_mail global send_mail
global stdout global stdout
global email_to_address global email_to_address
global host
global port
global portal_name
try: try:
opts, args = getopt.getopt(sys.argv[1:], opts, args = getopt.getopt(sys.argv[1:],
"hs", ["help", "stdout", "hs", ["help", "stdout",
"email_to_address="] ) "email_to_address=", "host=", "port=", "portal_name="] )
except getopt.GetoptError, msg: except getopt.GetoptError, msg:
usage(sys.stderr, msg) usage(sys.stderr, msg)
sys.exit(2) sys.exit(2)
...@@ -77,6 +85,13 @@ def parseArgs(): ...@@ -77,6 +85,13 @@ def parseArgs():
elif opt in ('-h', '--help'): elif opt in ('-h', '--help'):
usage(sys.stdout) usage(sys.stdout)
sys.exit() sys.exit()
elif opt == "--host":
host = arg
elif opt == "--port":
port = int(arg)
elif opt == "--portal_name":
portal_name = arg
if not stdout: if not stdout:
send_mail = 1 send_mail = 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment