diff --git a/buildout/local-eggs/erp5.recipe.standaloneinstance/src/erp5/recipe/standaloneinstance/create_erp5_instance.py b/buildout/local-eggs/erp5.recipe.standaloneinstance/src/erp5/recipe/standaloneinstance/create_erp5_instance.py index f2beb04efbe43c7f913e1c08b0055ba3666c0c69..af06b21b44adafbe654a5e2f9b8c4ed655584413 100644 --- a/buildout/local-eggs/erp5.recipe.standaloneinstance/src/erp5/recipe/standaloneinstance/create_erp5_instance.py +++ b/buildout/local-eggs/erp5.recipe.standaloneinstance/src/erp5/recipe/standaloneinstance/create_erp5_instance.py @@ -28,7 +28,8 @@ parser.add_option("-u", "--initial-user", default="zope:zope") parser.add_option("--bt5-path", dest="bt5_path", - help="Path to folder containing business templates", + help="Path to folder containing business templates. " + "Can be multiple, separated by commas.", default="bt5") (options, args) = parser.parse_args() @@ -44,6 +45,7 @@ options.erp5_sql_connection_string =\ unquote(options.erp5_sql_connection_string) options.cmf_activity_sql_connection_string =\ unquote(options.cmf_activity_sql_connection_string) + username, password = options.user_and_pass.split(':') try: @@ -89,8 +91,19 @@ if default_site_preference.getPreferenceState() == 'disabled': # install our business templates bt5_list = [] +bt5_path_list = options.bt5_path.split(',') + for arg in args: - bt_path = os.path.join(options.bt5_path, arg) + bt_path = None + for path in bt5_path_list: + bt_path = os.path.join(path, arg) + if os.path.exists(bt_path): + break + else: + bt_path = None + if bt_path is None: + raise ValueError('Business Template %s not found in paths %s' % (arg, + options.bt5_path)) installed_bt = portal.portal_templates.getInstalledBusinessTemplate(arg) if installed_bt is not None: # XXX this way works only for extracted business template, not for