diff --git a/.travis.yml b/.travis.yml index 324c1529..9ad2fb16 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,6 +48,7 @@ script: - sudo ee site create site4.org --wpfc --wp - sudo ee site create site5.com --wpsubdir - sudo ee site create site5.net --wpsubdir + - sudo ee site create site6.net --php --mysql - sudo ee site create site6.com --wpsubdir --wpsc - sudo ee site create site6.net --wpsc --wpsubdir diff --git a/ee/cli/plugins/site_functions.py b/ee/cli/plugins/site_functions.py index f51cdcb8..b30430ab 100644 --- a/ee/cli/plugins/site_functions.py +++ b/ee/cli/plugins/site_functions.py @@ -797,6 +797,22 @@ def detSitePar(opts): elif val and key in ['wpfc', 'wpsc', 'w3tc']: cachelist.append(key) + if len(typelist) > 1: + if set(['wpsubdir', 'wpsubdomain'].issubset(set[typelist])): + raise RuntimeError("could not determine site and cache type") + elif 'wpsubdir' in typelist: + typelist = 'wpsubdir' + elif 'wpsubdomain' in typelist: + typelist = 'wpsubdomain' + elif 'wp' in typelist: + typelist = 'wp' + elif 'mysql' in typelist: + typelist = 'mysql' + elif 'php' in typelist: + typelist = 'php' + else: + typelist = 'html' + if len(typelist) > 1 or len(cachelist) > 1: raise RuntimeError("could not determine site and cache type") else: @@ -807,11 +823,11 @@ def detSitePar(opts): sitetype = 'wp' cachetype = cachelist[0] elif typelist and (not cachelist): - sitetype = typelist[0] + sitetype = typelist cachetype = 'basic' else: - sitetype = typelist[0] - cachetype = cachelist[0] + sitetype = typelist + cachetype = cachelist return (sitetype, cachetype)