Skip to content

better support for custom folder installation #526

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 14, 2020

Conversation

streamnsight
Copy link
Member

I ran into issues running the tools when I had installed WLS with the dev zip download (v10.3 with a wls_home location of <oracle_home>/wlserver/

This asserts the folder exists, and if it does not, try to infer the folder name by scanning the folders in the oracle home and finding the one that starts with wlserver

@CarolynRountree CarolynRountree self-requested a review January 23, 2020 19:57
@streamnsight streamnsight requested a review from rakillen January 27, 2020 22:03
@ddsharpe
Copy link
Member

@streamnsight I would like to incorporate your change. But, it does not look like you have followed the process that we outline for all of the Oracle open-source projects. Can you please read https://github.com/oracle/weblogic-deploy-tooling/blob/master/CONTRIBUTING.md. You MUST have a signed OCA submitted.

@ddsharpe
Copy link
Member

@streamnsight I see that you are now a member of the Oracle group in GitHub. Thank you.

@ddsharpe
Copy link
Member

Unit tests are failing:

Problem invoking WLST - Traceback (innermost last):
File "/var/lib/jenkins/workspace/WebLogic_Deploy_Tooling_PR-526/core/target/wlst-tests/test/_wlst_test_driver.py", line 106, in ?
File "/var/lib/jenkins/workspace/WebLogic_Deploy_Tooling_PR-526/core/target/wlst-tests/test/_wlst_test_driver.py", line 101, in main
File "/var/lib/jenkins/workspace/WebLogic_Deploy_Tooling_PR-526/core/target/wlst-tests/test/_wlst_test_driver.py", line 44, in run_tests
File "/var/lib/jenkins/workspace/WebLogic_Deploy_Tooling_PR-526/core/target/wlst-tests/test/./aliases_test.py", line 26, in ?
File "/var/lib/jenkins/workspace/WebLogic_Deploy_Tooling_PR-526/core/target/wlst-tests/test/./aliases_test.py", line 39, in AliasesTestCase
File "/var/lib/jenkins/workspace/WebLogic_Deploy_Tooling_PR-526/core/target/wlst-tests/main/wlsdeploy/util/model_context.py", line 81, in init
File "/var/lib/jenkins/workspace/WebLogic_Deploy_Tooling_PR-526/core/target/wlst-tests/main/wlsdeploy/util/weblogic_helper.py", line 194, in get_weblogic_home
File "/u01/oracle/wlserver/common/wlst/modules/jython-modules.jar/Lib/javaos.py", line 135, in listdir
OSError: [Errno 0] No such directory: /oracleHome

if len(dirs) > 0:
wl_home = oracle_home + '/' + dirs[0]
else:
raise Exception("Can't find proper folder for WLS")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

throwing an exception here breaks 4 of the WLST unit tests. We could alter the unit tests to accommodate. But, is this necessary? What is the behavior if you simply log an error and let the code continue, versus throwing the exception? In either case, this string needs to be moved to the i18n properties file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you noted, a bunch of tests were failing because the ORACLE_HOME is mocked and my code change raised an exception when wl_home is not found.
I changed that to return None instead and leave it to downstream to check that it is not None instead.

…he wlserver home

Leaving it to downstream to check that wl_home is not None.
Signed-off by: Emmanuel Leroy <[email protected]>
if len(dirs) > 0:
wl_home = oracle_home + '/' + dirs[0]
else:
wl_home = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wl_home is already set to None, just above the if-statement. Please remove the last else-statement, and I think it should be good to go.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wls_home is not none: it gets set to oracle_home + '/' + wls_server_10.3 as default from the previous set of checks. The added code checked that the folder 'detected' is valid, and if not does an extra check to try to infer the folder. If that fails then it sets the wl_home to None again.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, you are correct. I missed that.

@ddsharpe ddsharpe merged commit c6c8460 into oracle:master Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants