Commit 953a64f9 authored by Jérome Perrin's avatar Jérome Perrin

supports --email_from_address=STRING in test runner, CMFActivity will send...

supports --email_from_address=STRING in test runner, CMFActivity will send failure notifications to this address.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9680 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 82fe6f9c
...@@ -410,30 +410,33 @@ def setupERP5Site( business_template_list=(), ...@@ -410,30 +410,33 @@ def setupERP5Site( business_template_list=(),
if not quiet: if not quiet:
ZopeTestCase._print('Adding %s ERP5 Site ... ' % portal_name) ZopeTestCase._print('Adding %s ERP5 Site ... ' % portal_name)
sql_connections_dict = {} extra_constructor_kw = {}
erp5_sql_connection_string = os.environ.get( erp5_sql_connection_string = os.environ.get(
'erp5_sql_connection_string') 'erp5_sql_connection_string')
if erp5_sql_connection_string: if erp5_sql_connection_string:
sql_connections_dict['erp5_sql_connection_string'] = \ extra_constructor_kw['erp5_sql_connection_string'] = \
erp5_sql_connection_string erp5_sql_connection_string
cmf_activity_sql_connection_string = os.environ.get( cmf_activity_sql_connection_string = os.environ.get(
'cmf_activity_sql_connection_string', 'cmf_activity_sql_connection_string',
os.environ.get('erp5_sql_connection_string')) os.environ.get('erp5_sql_connection_string'))
if cmf_activity_sql_connection_string: if cmf_activity_sql_connection_string:
sql_connections_dict['cmf_activity_sql_connection_string'] = \ extra_constructor_kw['cmf_activity_sql_connection_string'] = \
cmf_activity_sql_connection_string cmf_activity_sql_connection_string
erp5_sql_deferred_connection_string = os.environ.get( erp5_sql_deferred_connection_string = os.environ.get(
'erp5_sql_deferred_connection_string', 'erp5_sql_deferred_connection_string',
os.environ.get('erp5_sql_connection_string')) os.environ.get('erp5_sql_connection_string'))
if erp5_sql_deferred_connection_string: if erp5_sql_deferred_connection_string:
sql_connections_dict['erp5_sql_deferred_connection_string'] = \ extra_constructor_kw['erp5_sql_deferred_connection_string'] = \
erp5_sql_deferred_connection_string erp5_sql_deferred_connection_string
email_from_address = os.environ.get('email_from_address')
if email_from_address is not None:
extra_constructor_kw['email_from_address'] = email_from_address
factory = app.manage_addProduct['ERP5'] factory = app.manage_addProduct['ERP5']
factory.manage_addERP5Site(portal_name, factory.manage_addERP5Site(portal_name,
light_install=light_install, light_install=light_install,
reindex=reindex, reindex=reindex,
create_activities=create_activities, create_activities=create_activities,
**sql_connections_dict ) **extra_constructor_kw )
if not quiet: if not quiet:
ZopeTestCase._print('done (%.3fs)\n' % (time.time() - _start)) ZopeTestCase._print('done (%.3fs)\n' % (time.time() - _start))
......
...@@ -21,6 +21,10 @@ Options: ...@@ -21,6 +21,10 @@ Options:
ZSQL Connection string for ZSQL Connection string for
erp5_sql_deferred_connection (if unset, defaults erp5_sql_deferred_connection (if unset, defaults
to erp5_sql_connection_string) to erp5_sql_connection_string)
--email_from_address=STRING
Initialize the email_from_address property of the
portal, by defaults, CMFActivity failures are sent
on localhost from this address, to this address
""" """
...@@ -170,7 +174,9 @@ def main(): ...@@ -170,7 +174,9 @@ def main():
try: try:
opts, args = getopt.getopt(sys.argv[1:], opts, args = getopt.getopt(sys.argv[1:],
"hv", ["help", "verbose", "erp5_sql_connection_string=", "hv", ["help", "verbose", "erp5_sql_connection_string=",
"cmf_activity_sql_connection_string=", "erp5_deferred_sql_connection_string="] ) "cmf_activity_sql_connection_string=",
"erp5_deferred_sql_connection_string=",
"email_from_address="] )
except getopt.GetoptError, msg: except getopt.GetoptError, msg:
usage(sys.stderr, msg) usage(sys.stderr, msg)
sys.exit(2) sys.exit(2)
...@@ -187,6 +193,8 @@ def main(): ...@@ -187,6 +193,8 @@ def main():
os.environ["cmf_activity_sql_connection_string"] = arg os.environ["cmf_activity_sql_connection_string"] = arg
elif opt == "--erp5_sql_deferred_connection_string": elif opt == "--erp5_sql_deferred_connection_string":
os.environ["erp5_sql_deferred_connection_string"] = arg os.environ["erp5_sql_deferred_connection_string"] = arg
elif opt == "--email_from_address":
os.environ["email_from_address"] = arg
test_list = args test_list = args
if not test_list: if not test_list:
......
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