-
Couldn't load subscription status.
- Fork 16
Make sure applications are active in the cluster #43
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
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
weblogic-azure-aks/src/main/arm/scripts/py-scripts/checkApplicationStatus.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # Copyright (c) 2021, Oracle Corporation and/or its affiliates. | ||
| # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. | ||
|
|
||
| import sys | ||
|
|
||
| def usage(): | ||
| print(sys.argv[0] + '-user <domain-user> -password <domain-password> -t3ChannelAddress <address of the cluster> -t3ChannelPort <t3 channel port>') | ||
|
|
||
| if len(sys.argv) < 4: | ||
| usage() | ||
| sys.exit(0) | ||
|
|
||
| #domainUser is hard-coded to weblogic. You can change to other name of your choice. Command line paramter -user. | ||
| domainUser = 'weblogic' | ||
| #domainPassword will be passed by Command line parameter -password. | ||
| domainPassword = None | ||
| t3ChannelPort = None | ||
| t3ChannelAddress = None | ||
|
|
||
| i = 1 | ||
| while i < len(sys.argv): | ||
| if sys.argv[i] == '-user': | ||
| domainUser = sys.argv[i + 1] | ||
| i += 2 | ||
| elif sys.argv[i] == '-password': | ||
| domainPassword = sys.argv[i + 1] | ||
| i += 2 | ||
| elif sys.argv[i] == '-t3ChannelAddress': | ||
| t3ChannelAddress = sys.argv[i + 1] | ||
| i += 2 | ||
| elif sys.argv[i] == '-t3ChannelPort': | ||
| t3ChannelPort = sys.argv[i + 1] | ||
| i += 2 | ||
| else: | ||
| print('Unexpected argument switch at position ' + str(i) + ': ' + str(sys.argv[i])) | ||
| usage() | ||
| sys.exit(1) | ||
|
|
||
| t3ConnectionUri='t3://'+t3ChannelAddress+':'+t3ChannelPort | ||
| connect(domainUser, domainPassword, t3ConnectionUri) | ||
| myapps=cmo.getAppDeployments() | ||
| inactiveApp=0 | ||
| for app in myapps: | ||
| bean=getMBean('/AppDeployments/'+app.getName()+'/Targets/') | ||
| targetsbean=bean.getTargets() | ||
| for target in targetsbean: | ||
| domainRuntime() | ||
| cd('AppRuntimeStateRuntime/AppRuntimeStateRuntime') | ||
| appstatus=cmo.getCurrentState(app.getName(),target.getName()) | ||
| if appstatus != 'STATE_ACTIVE': | ||
| inactiveApp=inactiveApp+1 | ||
| serverConfig() | ||
|
|
||
| # TIGHT COUPLING: this exact print text is expected to indicate a successful return. | ||
| if inactiveApp == 0: | ||
| print("Summary: all applications are active!") | ||
| else: | ||
| print("Summary: number of inactive application:" + inactiveApp + '.') | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment:
// TIGHT COUPLING: this exact print text is expected to indicate a successful return.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @edburns fixed it in 848ce8b