Skip to content

Commit 8bf0d55

Browse files
fixing discovery warnings when discovering a soa domain (#1437)
* fixing discovery warnings when discovering a soa domain where the soa-infra app has subdeployments with / in the name * limiting the parens to only the WLST path created from a name token containing a slash * making the change for offline only since online works differently * Avoid adding extra parentheses to application and library paths * Add documentation about restart files for online deploy / update --------- Co-authored-by: Richard Killen <[email protected]>
1 parent 6088a18 commit 8bf0d55

File tree

5 files changed

+85
-5
lines changed

5 files changed

+85
-5
lines changed

core/src/main/python/wlsdeploy/aliases/alias_utils.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from wlsdeploy.aliases.alias_constants import ChildFoldersTypes
2828
from wlsdeploy.aliases.alias_constants import STRING
2929
from wlsdeploy.aliases.model_constants import MODEL_LIST_DELIMITER
30+
from wlsdeploy.aliases.wlst_modes import WlstModes
3031
from wlsdeploy.exception import exception_helper
3132
from wlsdeploy.logging.platform_logger import PlatformLogger
3233

@@ -61,6 +62,12 @@
6162
_logger = PlatformLogger('wlsdeploy.aliases')
6263
_windows_path_regex = re.compile(r'^[a-zA-Z]:[\\/].*')
6364

65+
# WARNING: DO NOT USE OUTSIDE OF THIS FILE!
66+
#
67+
# This variable gets set when the Aliases object is created so it will not be accurate
68+
# unless/until the Aliases constructor completes successfully.
69+
#
70+
_wlst_mode = WlstModes.OFFLINE
6471

6572
def merge_model_and_existing_lists(model_list, existing_list, location_path="(unknown)", attribute_name="(unknown)"):
6673
"""
@@ -428,6 +435,8 @@ def replace_tokens_in_path(location, path):
428435
new_path = path
429436
if name_tokens:
430437
for key, value in name_tokens.iteritems():
438+
if '/' in value and _wlst_mode == WlstModes.OFFLINE:
439+
value = '(%s)' % value
431440
new_path = new_path.replace('%s%s%s' % ('%', key, '%'), value)
432441

433442
missing_name_token = get_missing_name_tokens(new_path)

core/src/main/python/wlsdeploy/aliases/aliases.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def __init__(self, model_context, wlst_mode=WlstModes.OFFLINE, wls_version=None,
8585
self._alias_entries = AliasEntries(wlst_mode, self._wls_version)
8686
self._production_mode_enabled = False
8787
self._secure_mode_enabled = False
88+
alias_utils._wlst_mode = wlst_mode
8889

8990
def set_production_mode(self, production_mode_enabled):
9091
_method_name = 'set_production_mode'

core/src/main/python/wlsdeploy/tool/deploy/applications_deployer.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ def __add_shared_libraries(self):
104104
shared_library_token = self.aliases.get_name_token(shared_library_location)
105105

106106
for shared_library_name in shared_libraries:
107+
self.wlst_helper.cd(root_path) # avoid cd to pwd that may contain slashed names
107108
existing_shared_libraries = deployer_utils.get_existing_object_list(shared_library_location, self.aliases)
108109

109110
if model_helper.is_delete_name(shared_library_name):
@@ -133,8 +134,8 @@ def __add_shared_libraries(self):
133134

134135
library_name = \
135136
self.version_helper.get_library_versioned_name(shlib_source_path, shared_library_name)
136-
quoted_library_name = self.wlst_helper.get_quoted_name_for_wlst(library_name)
137-
shared_library_location.add_name_token(shared_library_token, quoted_library_name)
137+
# names are quoted/escaped later, when paths are resolved
138+
shared_library_location.add_name_token(shared_library_token, library_name)
138139

139140
self.wlst_helper.cd(root_path)
140141
deployer_utils.create_and_cd(shared_library_location, existing_shared_libraries, self.aliases)
@@ -184,6 +185,7 @@ def __add_applications(self):
184185
application_token = self.aliases.get_name_token(application_location)
185186

186187
for application_name in applications:
188+
self.wlst_helper.cd(root_path) # avoid cd to pwd that may contain slashed names
187189
existing_applications = deployer_utils.get_existing_object_list(application_location, self.aliases)
188190

189191
if model_helper.is_delete_name(application_name):
@@ -211,9 +213,8 @@ def __add_applications(self):
211213
self.version_helper.get_application_versioned_name(app_source_path, application_name,
212214
module_type=module_type)
213215

214-
quoted_application_name = self.wlst_helper.get_quoted_name_for_wlst(application_name)
215-
216-
application_location.add_name_token(application_token, quoted_application_name)
216+
# names are quoted/escaped later, when paths are resolved
217+
application_location.add_name_token(application_token, application_name)
217218

218219
self.wlst_helper.cd(root_path)
219220
deployer_utils.create_and_cd(application_location, existing_applications, self.aliases)

documentation/3.0/content/userguide/tools/deploy.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ When running the tool in WLST online mode, the deploy operation may require serv
4848
- `103` - The entire domain needs to be restarted.
4949
- `104` - The domain changes have been canceled because the changes in the model requires a domain restart and `-cancel_changes_if_restart_required` is specified.
5050

51+
52+
### Using output files
53+
54+
If the `-output_dir` command-line argument is specified, the tool will generate output files that provide information about servers and resources that need to be restarted. These files are only applicable for online deployments.
55+
56+
For more information about these files, see [Using output files]({{< relref "/userguide/tools/update#using-output-files" >}}) for the Update Domain Tool.
57+
58+
5159
### Using an encrypted model
5260

5361
If the model or variables file contains passwords encrypted with the WDT Encryption tool, decrypt the passwords during create with the `-use_encryption` flag on the command line to tell the Deploy Applications Tool that encryption is being used and to prompt for the encryption passphrase. As with the database passwords, the tool can also read the passphrase from standard input (for example, `stdin`) to allow the tool to run without any user input. You can bypass the stdin prompt with two other options. Store the passphrase in an environment variable, and use the environment variable name with command-line option `-passphrase_env`. Another option is to create a file containing the passphrase value. Pass this filename using the command-line option `-passphrase_file`.

documentation/3.0/content/userguide/tools/update.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,67 @@ When running the tool in WLST online mode, the update operation may require serv
5959
WebLogic Server to handle automating undeploy and deploy of an application that uses shared library when the library is
6060
updated in-place.
6161

62+
### Using output files
63+
64+
If the `-output_dir` command-line argument is specified, the tool will generate output files that provide information about servers and resources that need to be restarted. These files are only applicable for online deployments.
65+
66+
The file `restart.file` contains a list of servers and resources that need to be restarted. Here is an example:
67+
```text
68+
:AdminServer:Generic1:JDBCSystemResource
69+
:AdminServer::
70+
```
71+
72+
The file `non_dynamic_changes.file` contains text describing the attributes that will require a restart in order for new values to be applied. Here is an example:
73+
```text
74+
Server re-start is REQUIRED for the set of changes in progress.
75+
76+
The following non-dynamic attribute(s) have been changed on MBeans
77+
that require server re-start:
78+
MBean Changed : com.bea:Name=AdminServer,Type=Log,Server=AdminServer
79+
Attributes changed : RedirectStderrToServerLogEnabled, RedirectStdoutToServerLogEnabled
80+
81+
MBean Changed : com.bea:Name=MailSession-0,Type=MailSession
82+
Attributes changed : SessionPasswordEncrypted
83+
```
84+
85+
The file `results.json` contains information about servers and resources need to be restarted, and attribute values that require a restart in order for new values to be applied.
86+
```json
87+
{
88+
"nonDynamicChanges" : {
89+
"com.bea:Name=MailSession-0,Type=MailSession" : [
90+
"SessionPasswordEncrypted"
91+
],
92+
"com.bea:Name=AdminServer,Type=Log,Server=AdminServer" : [
93+
"RedirectStderrToServerLogEnabled",
94+
"RedirectStdoutToServerLogEnabled"
95+
]
96+
},
97+
"nonDynamicChangesText" : [
98+
"",
99+
"Server re-start is REQUIRED for the set of changes in progress.",
100+
"",
101+
"The following non-dynamic attribute(s) have been changed on MBeans",
102+
"that require server re-start:",
103+
"MBean Changed : com.bea:Name=AdminServer,Type=Log,Server=AdminServer",
104+
"Attributes changed : RedirectStderrToServerLogEnabled, RedirectStdoutToServerLogEnabled",
105+
"",
106+
"MBean Changed : com.bea:Name=MailSession-0,Type=MailSession",
107+
"Attributes changed : SessionPasswordEncrypted",
108+
""
109+
],
110+
"restarts" : [
111+
{
112+
"server" : "AdminServer",
113+
"resourceName" : "Generic1",
114+
"resourceType" : "JDBCSystemResource"
115+
},
116+
{
117+
"server" : "AdminServer"
118+
}
119+
]
120+
}
121+
```
122+
62123
### Using an encrypted model
63124

64125
If the model or variables file contains passwords encrypted with the WDT Encryption tool, decrypt the passwords during create with the `-use_encryption` flag on the command line to tell the Update Domain Tool that encryption is being used and to prompt for the encryption passphrase. As with the database passwords, the tool can also read the passphrase from standard input (for example, `stdin`) to allow the tool to run without any user input. You can bypass the stdin prompt with two other options. Store the passphrase in an environment variable, and use the environment variable name with command-line option `-passphrase_env`. Another option is to create a file containing the passphrase value. Pass this filename with the command-line option `-passphrase_file`.

0 commit comments

Comments
 (0)