Skip to content

Commit 706b155

Browse files
committed
fixing GitHub issue 1607 for handling deployment plan discovery with -skip_archive or -remote
1 parent 45156de commit 706b155

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

core/src/main/python/wlsdeploy/tool/discover/deployments_discoverer.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,10 @@ def _disconnect_target(self, application_name, application_dict, message):
543543
def _get_plan_path(self, plan_path, archive_file, source_name, deployment_type, deployment_name, deployment_dict):
544544
_method_name = '_get_plan_path'
545545

546+
if self._model_context.is_skip_archive():
547+
# Just return None so that the model plan file stays the same.
548+
return None
549+
546550
plan_dir = None
547551
if model_constants.PLAN_DIR in deployment_dict:
548552
plan_dir = deployment_dict[model_constants.PLAN_DIR]
@@ -551,19 +555,21 @@ def _get_plan_path(self, plan_path, archive_file, source_name, deployment_type,
551555

552556
if deployment_type == model_constants.LIBRARY:
553557
archive_entry_type = WLSDeployArchive.ArchiveEntryType.SHLIB_PLAN
554-
download_file_type = 'sharedLibraries'
555558
remote_archive_path = WLSDeployArchive.getShlibPlanArchivePath(plan_file_name)
556-
archive_add_method = archive_file.addSharedLibraryDeploymentPlan
557559
else:
558560
archive_entry_type = WLSDeployArchive.ArchiveEntryType.APPLICATION_PLAN
559-
download_file_type = 'applications'
560561
remote_archive_path = WLSDeployArchive.getApplicationPlanArchivePath(plan_file_name)
561-
archive_add_method = archive_file.addApplicationDeploymentPlan
562562

563563
if self._model_context.is_remote():
564564
new_plan_name = remote_archive_path
565565
self.add_to_remote_map(plan_path, new_plan_name, archive_entry_type.name())
566-
elif not self._model_context.is_skip_archive():
566+
else:
567+
if deployment_type == model_constants.LIBRARY:
568+
download_file_type = 'sharedLibraries'
569+
archive_add_method = archive_file.addSharedLibraryDeploymentPlan
570+
else:
571+
download_file_type = 'applications'
572+
archive_add_method = archive_file.addApplicationDeploymentPlan
567573
try:
568574
if self._model_context.is_ssh():
569575
plan_file_name = self.download_deployment_from_remote_server(
@@ -582,7 +588,7 @@ def _get_plan_path(self, plan_path, archive_file, source_name, deployment_type,
582588
_logger.throwing(class_name=_class_name, method_name=_method_name, error=de)
583589
raise de
584590

585-
return new_plan_name
591+
return new_plan_name
586592

587593
def _resolve_deployment_plan_path(self, plan_dir, plan_path):
588594
"""

documentation/4.0/content/userguide/tools/discover.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,24 @@ behavior.
2929
means that the tool must run on the same host as the domain's Administration Server and that the user running the
3030
tool needs full read access to the domain home directory structure. By default, the tool will gather files referenced
3131
by the domain configuration (for example, applications, domain libraries) and store those files in a zip file known as
32-
the archive file. To prevent the collection of these files, simply add the `-skip_archive` argument to the
33-
command-line use to invoke the tool.
32+
the archive file.
33+
34+
To prevent the collection of these files, simply add the `-skip_archive` argument to the
35+
command-line use to invoke the tool. This will result in a model file that has the original paths to the files that
36+
could not be collected.
3437
- online mode - Online mode uses WLST online to read the domain configuration using the Administration Server's MBeans.
3538
The user running the tool needs to provide the administrative credentials and URL to connect to the Administration
3639
Server. There are four options when running the tool:
3740
- Normal mode (default) - In this mode, the tool must run on the same host as the domain's Administration Server
3841
and the user running the tool must have full read access to the domain home directory structure and any other
3942
locations where domain-specific files are stored.
4043
- `-skip_archive` mode - In this mode, the tool can be run from anywhere since the archive file is not being created.
44+
As with offline mode, this will result in a model file that has the original paths to the files that
45+
could not be collected.
4146
- `-remote` mode - This mode is similar to `-skip_archive` mode except that the tool will generate a list of `TODO`
4247
messages that inform the user which artifacts needs to be gathered and added to an archive file in order to create
43-
a complete model of the domain.
48+
a complete model of the domain. The model file will be populated with the archive paths that need to be collected
49+
and added to an archive file to allow a new domain to be created.
4450
- SSH mode - In this mode, the tool can be run from any host for which you have set up SSH connectivity between the
4551
host where WDT is running and the host where the Administration Server is running. The `-ssh_user` (which, by
4652
default, is the same user running the tool) must have full read access to the domain home directory structure and

0 commit comments

Comments
 (0)