|
12 | 12 | from java.lang import IllegalArgumentException |
13 | 13 | from java.lang import IllegalStateException |
14 | 14 | from java.lang import String |
15 | | - |
16 | 15 | from oracle.weblogic.deploy.aliases import AliasException |
17 | 16 | from oracle.weblogic.deploy.discover import DiscoverException |
18 | 17 | from oracle.weblogic.deploy.util import CLAException |
19 | 18 | from oracle.weblogic.deploy.util import FileUtils |
20 | 19 | from oracle.weblogic.deploy.util import PyWLSTException |
21 | 20 | from oracle.weblogic.deploy.util import TranslateException |
22 | | -from oracle.weblogic.deploy.util import WebLogicDeployToolingVersion |
23 | 21 | from oracle.weblogic.deploy.util import WLSDeployArchive |
24 | 22 | from oracle.weblogic.deploy.util import WLSDeployArchiveIOException |
| 23 | +from oracle.weblogic.deploy.util import WebLogicDeployToolingVersion |
| 24 | +from oracle.weblogic.deploy.validate import ValidateException |
25 | 25 |
|
26 | 26 | sys.path.append(os.path.dirname(os.path.realpath(sys.argv[0]))) |
27 | 27 |
|
28 | 28 | from wlsdeploy.aliases.wlst_modes import WlstModes |
29 | 29 | from wlsdeploy.exception import exception_helper |
30 | 30 | from wlsdeploy.logging.platform_logger import PlatformLogger |
31 | 31 | from wlsdeploy.util import getcreds |
32 | | -from wlsdeploy.tool.util.variable_injector import VariableInjector |
33 | 32 | from wlsdeploy.tool.discover import discoverer |
34 | 33 | from wlsdeploy.tool.discover.deployments_discoverer import DeploymentsDiscoverer |
35 | 34 | from wlsdeploy.tool.discover.domain_info_discoverer import DomainInfoDiscoverer |
36 | 35 | from wlsdeploy.tool.discover.multi_tenant_discoverer import MultiTenantDiscoverer |
37 | 36 | from wlsdeploy.tool.discover.resources_discoverer import ResourcesDiscoverer |
38 | 37 | from wlsdeploy.tool.discover.topology_discoverer import TopologyDiscoverer |
39 | 38 | from wlsdeploy.tool.util import filter_helper |
| 39 | +from wlsdeploy.tool.util.variable_injector import VariableInjector |
| 40 | +from wlsdeploy.tool.validate.validator import Validator |
40 | 41 | from wlsdeploy.util import wlst_helper |
41 | 42 | from wlsdeploy.util import model_translator |
42 | 43 | from wlsdeploy.util.cla_utils import CommandLineArgUtil |
@@ -373,25 +374,25 @@ def __check_and_customize_model(model, model_context): |
373 | 374 | inject_variables_keyword_file() |
374 | 375 | if inserted: |
375 | 376 | model = Model(variable_model) |
376 | | - # try: |
377 | | - # validator = Validator(model_context, wlst_mode=__wlst_mode) |
378 | | - # |
379 | | - # # no variables are generated by the discover tool |
380 | | - # validator.validate_in_tool_mode(model.get_model(), variables_file_name=variable_file_name, |
381 | | - # archive_file_name=model_context.get_archive_file_name()) |
382 | | - # except ValidateException, ex: |
383 | | - # __logger.warning('WLSDPLY-06015', ex.getLocalizedMessage(), class_name=_class_name, method_name=_method_name) |
| 377 | + try: |
| 378 | + validator = Validator(model_context, wlst_mode=__wlst_mode) |
| 379 | + |
| 380 | + # no variables are generated by the discover tool |
| 381 | + validator.validate_in_tool_mode(model.get_model(), variables_file_name=variable_file_name, |
| 382 | + archive_file_name=model_context.get_archive_file_name()) |
| 383 | + except ValidateException, ex: |
| 384 | + __logger.warning('WLSDPLY-06015', ex.getLocalizedMessage(), class_name=_class_name, method_name=_method_name) |
384 | 385 | return model |
385 | 386 |
|
386 | 387 |
|
387 | | -def __log_and_exit(exit_code, _class_name, _method_name): |
| 388 | +def __log_and_exit(exit_code, class_name, _method_name): |
388 | 389 | """ |
389 | 390 | Helper method to log the exiting message and call sys.exit() |
390 | 391 | :param exit_code: the exit code to use |
391 | | - :param _class_name: the class name to pass to the logger |
| 392 | + :param class_name: the class name to pass to the logger |
392 | 393 | :param _method_name: the method name to pass to the logger |
393 | 394 | """ |
394 | | - __logger.exiting(result=exit_code, class_name=_class_name, method_name=_method_name) |
| 395 | + __logger.exiting(result=exit_code, class_name=class_name, method_name=_method_name) |
395 | 396 | sys.exit(exit_code) |
396 | 397 |
|
397 | 398 |
|
@@ -444,7 +445,7 @@ def main(args): |
444 | 445 |
|
445 | 446 | except TranslateException, ex: |
446 | 447 | __logger.severe('WLSDPLY-20024', _program_name, model_context.get_archive_file_name(), ex.getLocalizedMessage(), |
447 | | - error=ex, class_name=_class_name, method_name=_method_name) |
| 448 | + error=ex, class_name=_class_name, method_name=_method_name) |
448 | 449 | __log_and_exit(CommandLineArgUtil.PROG_ERROR_EXIT_CODE, _class_name, _method_name) |
449 | 450 |
|
450 | 451 | __close_archive(model_context) |
|
0 commit comments