|
48 | 48 | from wlsdeploy.util.weblogic_helper import WebLogicHelper |
49 | 49 | from wlsdeploy.tool.create import atp_helper |
50 | 50 | from wlsdeploy.tool.create import ssl_helper |
| 51 | +from wlsdeploy.aliases.model_constants import DOMAIN_INFO |
| 52 | +from wlsdeploy.aliases.model_constants import DRIVER_PARAMS_NET_TNS_ADMIN |
51 | 53 |
|
52 | 54 | wlst_helper.wlst_functions = globals() |
53 | 55 |
|
@@ -237,43 +239,47 @@ def validate_rcu_args_and_model(model_context, model, archive_helper, aliases): |
237 | 239 |
|
238 | 240 | has_atpdbinfo = 0 |
239 | 241 | has_ssldbinfo = 0 |
240 | | - domain_info = model[model_constants.DOMAIN_INFO] |
241 | | - if domain_info is not None: |
242 | | - if model_constants.RCU_DB_INFO in domain_info: |
243 | | - rcu_db_info = RcuDbInfo(model_context, aliases, domain_info[model_constants.RCU_DB_INFO]) |
244 | | - has_tns_admin = rcu_db_info.has_tns_admin() |
245 | | - has_regular_db = rcu_db_info.is_regular_db() |
246 | | - has_atpdbinfo = rcu_db_info.has_atpdbinfo() |
247 | | - has_ssldbinfo = rcu_db_info.has_ssldbinfo() |
248 | | - |
249 | | - if archive_helper and not has_regular_db: |
250 | | - System.setProperty('oracle.jdbc.fanEnabled', 'false') |
251 | | - |
252 | | - # 1. If it does not have the oracle.net.tns_admin specified, then extract to domain/atpwallet |
253 | | - # 2. If it is plain old regular oracle db, do nothing |
254 | | - # 3. If it deos not have tns_admin in the model, then the wallet must be in the archive |
255 | | - if not has_tns_admin: |
256 | | - wallet_path = archive_helper.extract_atp_wallet() |
257 | | - if wallet_path: |
258 | | - # update the model to add the tns_admin |
259 | | - model[model_constants.DOMAIN_INFO][model_constants.RCU_DB_INFO][ |
260 | | - model_constants.DRIVER_PARAMS_NET_TNS_ADMIN] = wallet_path |
261 | | - else: |
262 | | - __logger.severe('WLSDPLY-12411', error=None, class_name=_class_name, method_name=_method_name) |
263 | | - cla_helper.clean_up_temp_files() |
264 | | - tool_exit.end(model_context, ExitCode.ERROR) |
265 | | - |
266 | | - else: |
267 | | - if model_context.get_domain_typedef().required_rcu(): |
268 | | - if not model_context.get_rcu_database() or not model_context.get_rcu_prefix(): |
269 | | - __logger.severe('WLSDPLY-12408', model_context.get_domain_type(), CommandLineArgUtil.RCU_DB_SWITCH, |
270 | | - CommandLineArgUtil.RCU_PREFIX_SWITCH) |
271 | | - cla_helper.clean_up_temp_files() |
272 | | - tool_exit.end(model_context, ExitCode.ERROR) |
| 242 | + |
| 243 | + if model_constants.DOMAIN_INFO in model and model_constants.RCU_DB_INFO in model[model_constants.DOMAIN_INFO]: |
| 244 | + rcu_db_info = RcuDbInfo(model_context, aliases, model[model_constants.DOMAIN_INFO][model_constants.RCU_DB_INFO]) |
| 245 | + has_tns_admin = rcu_db_info.has_tns_admin() |
| 246 | + is_regular_db = rcu_db_info.is_regular_db() |
| 247 | + has_atpdbinfo = rcu_db_info.has_atpdbinfo() |
| 248 | + has_ssldbinfo = rcu_db_info.has_ssldbinfo() |
| 249 | + |
| 250 | + _validate_atp_wallet_in_archive(archive_helper, is_regular_db, has_tns_admin, model, |
| 251 | + model_context) |
| 252 | + else: |
| 253 | + if model_context.get_domain_typedef().required_rcu(): |
| 254 | + if not model_context.get_rcu_database() or not model_context.get_rcu_prefix(): |
| 255 | + __logger.severe('WLSDPLY-12408', model_context.get_domain_type(), CommandLineArgUtil.RCU_DB_SWITCH, |
| 256 | + CommandLineArgUtil.RCU_PREFIX_SWITCH) |
| 257 | + cla_helper.clean_up_temp_files() |
| 258 | + tool_exit.end(model_context, CommandLineArgUtil.PROG_ERROR_EXIT_CODE) |
273 | 259 |
|
274 | 260 | return has_atpdbinfo, has_ssldbinfo |
275 | 261 |
|
276 | 262 |
|
| 263 | +def _validate_atp_wallet_in_archive(archive_helper, is_regular_db, has_tns_admin, model, model_context): |
| 264 | + if archive_helper and not is_regular_db: |
| 265 | + # 1. If it does not have the oracle.net.tns_admin specified, then extract to domain/atpwallet |
| 266 | + # 2. If it is plain old regular oracle db, do nothing |
| 267 | + # 3. If it deos not have tns_admin in the model, then the wallet must be in the archive |
| 268 | + if not has_tns_admin: |
| 269 | + wallet_path = archive_helper.extract_atp_wallet() |
| 270 | + if wallet_path: |
| 271 | + # update the model to add the tns_admin |
| 272 | + model[model_constants.DOMAIN_INFO][model_constants.RCU_DB_INFO][ |
| 273 | + model_constants.DRIVER_PARAMS_NET_TNS_ADMIN] = wallet_path |
| 274 | + else: |
| 275 | + __logger.severe('WLSDPLY-12411', error=None, class_name=_class_name, method_name=_method_name) |
| 276 | + cla_helper.clean_up_temp_files() |
| 277 | + tool_exit.end(model_context, CommandLineArgUtil.PROG_ERROR_EXIT_CODE) |
| 278 | + |
| 279 | + if not is_regular_db: |
| 280 | + System.setProperty('oracle.jdbc.fanEnabled', 'false') |
| 281 | + |
| 282 | + |
277 | 283 | def _get_domain_path(model_context, model): |
278 | 284 | """ |
279 | 285 | Returns the domain home path. |
@@ -332,16 +338,17 @@ def main(args): |
332 | 338 | archive_helper = ArchiveHelper(archive_file_name, domain_path, __logger, ExceptionType.CREATE) |
333 | 339 |
|
334 | 340 | has_atp, has_ssl = validate_rcu_args_and_model(model_context, model_dictionary, archive_helper, aliases) |
335 | | - |
336 | 341 | # check if there is an atpwallet and extract in the domain dir |
337 | 342 | # it is to support non JRF domain but user wants to use ATP database |
338 | | - if not has_atp and archive_helper: |
| 343 | + if has_atp and archive_helper: |
339 | 344 | archive_helper.extract_atp_wallet() |
340 | 345 |
|
341 | 346 | creator = DomainCreator(model_dictionary, model_context, aliases) |
342 | 347 | creator.create() |
343 | 348 |
|
344 | 349 | if has_atp: |
| 350 | + # if extracted_wallet_path is not None: |
| 351 | + # model_dictionary[DOMAIN_INFO][DRIVER_PARAMS_NET_TNS_ADMIN] = extracted_wallet_path |
345 | 352 | rcu_properties_map = model_dictionary[model_constants.DOMAIN_INFO][model_constants.RCU_DB_INFO] |
346 | 353 | rcu_db_info = RcuDbInfo(model_context, aliases, rcu_properties_map) |
347 | 354 | atp_helper.fix_jps_config(rcu_db_info, model_context) |
|
0 commit comments