Skip to content

Commit c6c8460

Browse files
authored
better support for custom folder installation (#526)
* Better support for custom folder installation Signed-off-by: Emmanuel Leroy <emmanuel.leroy@oracle.com> * fix case when oracle_home is not a dir. will return None. Signed-off by: Emmanuel Leroy <emmanuel.leroy@oracle.com> * fix tests that were failing due to exception raised for not finding the wlserver home Leaving it to downstream to check that wl_home is not None. Signed-off by: Emmanuel Leroy <emmanuel.leroy@oracle.com>
1 parent d2eee97 commit c6c8460

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

core/src/main/python/wlsdeploy/util/weblogic_helper.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
from wlsdeploy.exception import exception_helper
1414
from wlsdeploy.util import string_utils
1515

16+
import os
17+
import re
1618

1719
class WebLogicHelper(object):
1820
"""
@@ -187,6 +189,14 @@ def get_weblogic_home(self, oracle_home):
187189
else:
188190
wl_home = oracle_home + '/wlserver_10.3'
189191

192+
# if the path is not a valid directory, try to infer it from the pattern
193+
if os.path.isdir(oracle_home) and not os.path.isdir(wl_home):
194+
dirs = [f for f in os.listdir(oracle_home) if re.match(r'wlserver.*', f)]
195+
if len(dirs) > 0:
196+
wl_home = oracle_home + '/' + dirs[0]
197+
else:
198+
wl_home = None
199+
190200
return wl_home
191201

192202
def is_weblogic_version_or_above(self, str_version, use_actual_version=False):

0 commit comments

Comments
 (0)