diff --git a/core/src/main/python/create.py b/core/src/main/python/create.py index 4b8bdc41c..9857a552a 100644 --- a/core/src/main/python/create.py +++ b/core/src/main/python/create.py @@ -193,7 +193,7 @@ def __process_rcu_args(optional_arg_map, domain_type, domain_typedef): error=ioe) __logger.throwing(ex, class_name=_class_name, method_name=_method_name) raise ex - optional_arg_map[CommandLineArgUtil.RCU_SYS_PASS_SWITCH] = String(password) + optional_arg_map[CommandLineArgUtil.RCU_SYS_PASS_SWITCH] = str(String(password)) if CommandLineArgUtil.RCU_SCHEMA_PASS_SWITCH not in optional_arg_map: try: password = getcreds.getpass('WLSDPLY-12405') @@ -203,7 +203,7 @@ def __process_rcu_args(optional_arg_map, domain_type, domain_typedef): error=ioe) __logger.throwing(ex, class_name=_class_name, method_name=_method_name) raise ex - optional_arg_map[CommandLineArgUtil.RCU_SCHEMA_PASS_SWITCH] = String(password) + optional_arg_map[CommandLineArgUtil.RCU_SCHEMA_PASS_SWITCH] = str(String(password)) else: ex = exception_helper.create_cla_exception(ExitCode.USAGE_ERROR, 'WLSDPLY-12407', _program_name, @@ -232,7 +232,7 @@ def __process_opss_args(optional_arg_map): 'WLSDPLY-20028', ioe.getLocalizedMessage(), error=ioe) __logger.throwing(ex, class_name=_class_name, method_name=_method_name) raise ex - optional_arg_map[CommandLineArgUtil.OPSS_WALLET_PASSPHRASE] = String(passphrase) + optional_arg_map[CommandLineArgUtil.OPSS_WALLET_PASSPHRASE] = str(String(passphrase)) def validate_rcu_args_and_model(model_context, model, archive_helper, aliases): diff --git a/core/src/main/python/wlsdeploy/tool/create/domain_creator.py b/core/src/main/python/wlsdeploy/tool/create/domain_creator.py index 7722af578..3b3fb7df0 100644 --- a/core/src/main/python/wlsdeploy/tool/create/domain_creator.py +++ b/core/src/main/python/wlsdeploy/tool/create/domain_creator.py @@ -270,9 +270,9 @@ def __run_rcu(self): rcu_db_info = rcudbinfo_helper.create(self.model.get_model(), self.model_context, self.aliases) # get these values from the command-line or RCUDbInfo in the model - rcu_prefix = rcu_db_info.get_preferred_prefix() - rcu_sys_pass = rcu_db_info.get_preferred_sys_pass() - rcu_schema_pass = rcu_db_info.get_preferred_schema_pass() + rcu_prefix = rcu_db_info.get_rcu_prefix() + rcu_sys_pass = rcu_db_info.get_admin_password() + rcu_schema_pass = rcu_db_info.get_rcu_schema_password() database_type = rcu_db_info.get_database_type() if database_type is not None and database_type not in ['SSL', 'ATP', 'ORACLE']: @@ -328,7 +328,7 @@ def __run_rcu(self): truststore, keystore_pwd, keystore_type, keystore = self.__validate_and_get_ssl_rcudbinfo(rcu_db_info) rcu_runner_map = dict() - rcu_db_user = rcu_db_info.get_preferred_db_user() + rcu_db_user = rcu_db_info.get_rcu_db_user() ssl_conn_properties = dict() self._set_rcu_ssl_args_properties(ssl_conn_properties, rcu_db_info, keystore, keystore_type, truststore, @@ -343,13 +343,13 @@ def __run_rcu(self): runner.setRCUAdminUser(rcu_db_user) else: # Non-ATP database, use DB config from the command line or RCUDbInfo in the model. - rcu_db = rcu_db_info.get_preferred_db() + rcu_db = rcu_db_info.get_rcu_regular_db_conn() if rcu_db is None: ex = exception_helper.create_create_exception('WLSDPLY-12572') raise ex - rcu_db_user = rcu_db_info.get_preferred_db_user() + rcu_db_user = rcu_db_info.get_rcu_db_user() runner = RCURunner.createRunner(domain_type, oracle_home, java_home, rcu_db, rcu_prefix, rcu_schemas, rcu_db_info.get_rcu_variables()) @@ -1050,7 +1050,7 @@ def __validate_and_get_atp_rcudbinfo(self, rcu_db_info, check_admin_pwd=False): _method_name = '__validate_and_get_atp_rcudbinfo' tns_admin = rcu_db_info.get_tns_admin() - rcu_database = rcu_db_info.get_preferred_db() + rcu_database = rcu_db_info.get_rcu_regular_db_conn() if rcu_database is None: if tns_admin is None or not os.path.exists(tns_admin + os.sep + "tnsnames.ora"): @@ -1109,7 +1109,7 @@ def __validate_and_get_ssl_rcudbinfo(self, rcu_db_info, check_admin_pwd=False): tns_admin = rcu_db_info.get_tns_admin() truststore = rcu_db_info.get_truststore() - rcu_database = rcu_db_info.get_preferred_db() + rcu_database = rcu_db_info.get_rcu_regular_db_conn() # If user specify connect string, no need to fetch from tnsnames.ora if rcu_database is None: @@ -1547,8 +1547,8 @@ def get_rcu_basic_connection_info(self, rcu_db_info): truststore_pwd = None truststore_type = None - rcu_prefix = rcu_db_info.get_preferred_prefix() - rcu_schema_pwd = rcu_db_info.get_preferred_schema_pass() + rcu_prefix = rcu_db_info.get_rcu_prefix() + rcu_schema_pwd = rcu_db_info.get_rcu_schema_password() if rcu_prefix is None: ex = exception_helper.create_create_exception('WLSDPLY-12413', 'rcu_prefix', "['rcu_prefix','rcu_schema_password']") @@ -1573,7 +1573,7 @@ def get_rcu_basic_connection_info(self, rcu_db_info): tns_admin, rcu_database, truststore_pwd, truststore_type, \ truststore, keystore_pwd, keystore_type, keystore = self.__validate_and_get_ssl_rcudbinfo(rcu_db_info) else: - rcu_database = rcu_db_info.get_preferred_db() + rcu_database = rcu_db_info.get_rcu_regular_db_conn() if rcu_database is None: ex = exception_helper.create_create_exception('WLSDPLY-12564') raise ex diff --git a/core/src/main/python/wlsdeploy/tool/create/rcudbinfo_helper.py b/core/src/main/python/wlsdeploy/tool/create/rcudbinfo_helper.py index f0c162681..d649d66ed 100644 --- a/core/src/main/python/wlsdeploy/tool/create/rcudbinfo_helper.py +++ b/core/src/main/python/wlsdeploy/tool/create/rcudbinfo_helper.py @@ -30,6 +30,7 @@ from wlsdeploy.aliases.model_constants import RCU_DEFAULT_TBLSPACE from wlsdeploy.aliases.model_constants import RCU_TEMP_TBLSPACE from wlsdeploy.util import dictionary_utils +from wlsdeploy.util import string_utils from wlsdeploy.util.model_context import ModelContext from wlsdeploy.logging.platform_logger import PlatformLogger @@ -90,11 +91,17 @@ def get_tns_entry(self): return None def get_rcu_prefix(self): - return self._get_dictionary_element_value(RCU_PREFIX) + rcu_prefix = self.model_context.get_rcu_prefix() + if string_utils.is_empty(rcu_prefix): + rcu_prefix = self._get_dictionary_element_value(RCU_PREFIX) + return rcu_prefix def get_rcu_schema_password(self): - password = self._get_dictionary_element_value(RCU_SCHEMA_PASSWORD) - return self.aliases.decrypt_password(password) + rcu_schema_pass = self.model_context.get_rcu_schema_pass() + if string_utils.is_empty(rcu_schema_pass): + password = self._get_dictionary_element_value(RCU_SCHEMA_PASSWORD) + rcu_schema_pass = self.aliases.decrypt_password(password) + return rcu_schema_pass def get_keystore(self): return self._get_dictionary_element_value(DRIVER_PARAMS_KEYSTORE_PROPERTY) @@ -117,11 +124,17 @@ def get_truststore_password(self): return self.aliases.decrypt_password(password) def get_admin_password(self): - password = self._get_dictionary_element_value(RCU_ADMIN_PASSWORD) - return self.aliases.decrypt_password(password) + rcu_admin_pass = self.model_context.get_rcu_sys_pass() + if string_utils.is_empty(rcu_admin_pass): + password = self._get_dictionary_element_value(RCU_ADMIN_PASSWORD) + rcu_admin_pass = self.aliases.decrypt_password(password) + return rcu_admin_pass def get_rcu_regular_db_conn(self): - return self._get_dictionary_element_value(RCU_DB_CONN) + rcu_db_conn = self.model_context.get_rcu_database() + if string_utils.is_empty(rcu_db_conn): + rcu_db_conn = self._get_dictionary_element_value(RCU_DB_CONN) + return rcu_db_conn def get_atp_default_tablespace(self): _method_name = 'get_atp_default_tablespace' @@ -160,11 +173,15 @@ def get_atp_admin_user(self): return 'admin' def get_rcu_db_user(self): + cli_admin_user = self.model_context.get_rcu_db_user() + if cli_admin_user != ModelContext.DB_USER_DEFAULT: + return cli_admin_user + result = self._get_dictionary_element_value(RCU_DB_USER) if result is not None: return result else: - return ModelContext.DB_USER_DEFAULT + return cli_admin_user def get_comp_info_location(self): result = self._get_dictionary_element_value(RCU_COMP_INFO) @@ -197,14 +214,8 @@ def has_atpdbinfo(self): def has_ssldbinfo(self): return self.is_use_ssl() - def is_multidatasource(self): - if self.get_multidatasource_urls() is not None and self.get_database_type() != 'AGL': - return True - else: - return False - def is_regular_db(self): - result = self._get_dictionary_element_value(RCU_DB_CONN) + result = self.get_rcu_regular_db_conn() if result is not None: if self.get_database_type() == 'ORACLE' and not (self.is_use_atp() or self.is_use_ssl()): return True @@ -242,56 +253,6 @@ def is_use_ssl(self): value = alias_utils.convert_to_type('boolean', model_value) return value == 'true' return self.get_database_type() == 'SSL' - - def get_preferred_db(self): - """ - Return the regular db connect string from command line or model. - :return: the db connect string - """ - cli_value = self.model_context.get_rcu_database() - if cli_value is not None: - return cli_value - return self.get_rcu_regular_db_conn() - - def get_preferred_db_user(self): - """ - Return the db user from command line or model. - :return: the db user - """ - cli_value = self.model_context.get_rcu_db_user() - if cli_value != ModelContext.DB_USER_DEFAULT: - return cli_value - return self.get_rcu_db_user() - - def get_preferred_prefix(self): - """ - Return the prefix from command line or model. - :return: the prefix - """ - cli_value = self.model_context.get_rcu_prefix() - if cli_value is not None: - return cli_value - return self.get_rcu_prefix() - - def get_preferred_schema_pass(self): - """ - Return the schema password from command line or model. - :return: the schema password - """ - cli_value = self.model_context.get_rcu_schema_pass() - if cli_value is not None: - return cli_value - return self.get_rcu_schema_password() - - def get_preferred_sys_pass(self): - """ - Return the system password from command line or model. - :return: the system password - """ - cli_value = self.model_context.get_rcu_sys_pass() - if cli_value is not None: - return cli_value - return self.get_admin_password() def create(model_dictionary, model_context, aliases): diff --git a/core/src/main/python/wlsdeploy/util/cla_utils.py b/core/src/main/python/wlsdeploy/util/cla_utils.py index 8e1d043e3..5ae58acd6 100644 --- a/core/src/main/python/wlsdeploy/util/cla_utils.py +++ b/core/src/main/python/wlsdeploy/util/cla_utils.py @@ -276,22 +276,27 @@ def process_args(self, args, tool_type=TOOL_TYPE_DEFAULT, trailing_arg_count=0): value, idx = self._get_arg_value(args, idx) self._validate_rcu_database_arg(value) self._add_arg(key, value) + _logger.deprecation('WLSDPLY-31000') elif self.is_rcu_dbuser_key(key): value, idx = self._get_arg_value(args, idx) self._validate_rcu_dbuser_arg(value) self._add_arg(key, value) + _logger.deprecation('WLSDPLY-31001') elif self.is_rcu_prefix_key(key): value, idx = self._get_arg_value(args, idx) self._validate_rcu_prefix_arg(value) self._add_arg(key, value) + _logger.deprecation('WLSDPLY-31002') elif self.is_rcu_sys_pass_key(key): value, idx = self._get_arg_value(args, idx) self._validate_rcu_sys_pass_arg(value) self._add_arg(key, value) + _logger.deprecation('WLSDPLY-31003') elif self.is_rcu_schema_pass_key(key): value, idx = self._get_arg_value(args, idx) self._validate_rcu_schema_pass_arg(value) self._add_arg(key, value) + _logger.deprecation('WLSDPLY-31004') elif self.is_passphrase_switch(key): value, idx = self._get_arg_value(args, idx) self._validate_passphrase_arg(value) diff --git a/core/src/main/resources/oracle/weblogic/deploy/messages/wlsdeploy_rb.properties b/core/src/main/resources/oracle/weblogic/deploy/messages/wlsdeploy_rb.properties index 0c962479d..638c3384e 100644 --- a/core/src/main/resources/oracle/weblogic/deploy/messages/wlsdeploy_rb.properties +++ b/core/src/main/resources/oracle/weblogic/deploy/messages/wlsdeploy_rb.properties @@ -1868,3 +1868,15 @@ WLSDPLY-30059=Failed to add the RCU wallet from {0} with overwrite value {1} to WLSDPLY-30060=The archiveHelper remove rcuWallet command removed {0} entries from archive file {1}. WLSDPLY-30061=Failed to remove RCU database wallet from archive file {0}: {1}. WLSDPLY-30062=Failed to remove RCU database wallet with force value {0} from archive file {1}: {2}. + +# Overflow for cla_utils.py +WLSDPLY-31000=The Create Domain tool's -rcu_db argument is deprecated and will be removed in a future release. \ + Please use the rcu_db_conn_string attribute under the RCUDbInfo section of the model instead. +WLSDPLY-31001=The Create Domain tool's -rcu_db_user argument is deprecated and will be removed in a future release. \ + Please use the rcu_db_user attribute under the RCUDbInfo section of the model instead. +WLSDPLY-31002=The Create Domain tool's -rcu_prefix argument is deprecated and will be removed in a future release. \ + Please use the rcu_prefix attribute under the RCUDbInfo section of the model instead. +WLSDPLY-31003=The Create Domain tool's -rcu_sys_pass argument is deprecated and will be removed in a future release. \ + Please use the rcu_admin_password attribute under the RCUDbInfo section of the model instead. +WLSDPLY-31004=The Create Domain tool's -rcu_schema_pass argument is deprecated and will be removed in a future release. \ + Please use the rcu_schema_password attribute under the RCUDbInfo section of the model instead. diff --git a/documentation/3.0/content/userguide/tools/create.md b/documentation/3.0/content/userguide/tools/create.md index b899bca9d..ef6b3c48c 100644 --- a/documentation/3.0/content/userguide/tools/create.md +++ b/documentation/3.0/content/userguide/tools/create.md @@ -61,23 +61,23 @@ topology: ``` ### Parameter table for `createDomain` -| Parameter | Definition | Default | -| --- | --- | --- | +| Parameter | Definition | Default | +| --- |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| --- | | `-archive_file` | The path to the archive file to use. If the `-model_file` argument is not specified, the model file in this archive will be used. This can also be specified as a comma-separated list of archive files. The overlapping contents in each archive take precedence over previous archives in the list. | | -| `-domain_home` | Required if `-domain_parent` is not used. The full directory and name where the domain should be created. -| `-domain_parent` | Required if `-domain_home` is not used. The parent directory where the domain should be created. The name is the domain name in the model. | | -| `-domain_type` | The type of domain (for example, `WLS`, `JRF`). | `WLS` | -| `-java_home` | The Java home to use for the new domain. If not specified, it defaults to the value of the `JAVA_HOME` environment variable. | | -| `-model_file` | The location of the model file. This can also be specified as a comma-separated list of model locations, where each successive model layers on top of the previous ones. | | -| `-oracle_home` | Home directory of the Oracle WebLogic installation. Required if the `ORACLE_HOME` environment variable is not set.| | -| `-opss_wallet` | The location of the Oracle wallet containing the domain's encryption key required to reconnect to an existing set of RCU schemas. | | -| `-opss_wallet_passphrase_env` | An alternative to entering the OPSS wallet passphrase at a prompt. The value is an environment variable name that WDT will use to retrieve the passphrase. | | -| `-opss_wallet_passphrase_file` | An alternative to entering the OPSS wallet passphrase at a prompt. The value is the name of a file with a string value which WDT will read to retrieve the passphrase. -| `-passphrase_env` | An alternative to entering the encryption passphrase at a prompt. The value is an environment variable name that WDT will use to retrieve the passphrase. | | -| `-passphrase_file` | An alternative to entering the encryption passphrase at a prompt. The value is the name of a file with a string value which WDT will read to retrieve the passphrase. | | -| `-rcu_database` | The RCU database connect string. | | -| `-rcu_prefix` | The RCU prefix to use. | | -| `-rcu_db_user` | The RCU `dbUser` to use. | `sys` | -| `-run_rcu` | Run RCU to create the database schemas specified by the domain type using the specified RCU prefix. Running RCU will drop any existing schemas with the same RCU prefix if they exist prior to trying to create them. | | -| `-use_encryption` | One or more of the passwords in the model or variables file(s) are encrypted and must be decrypted. Java 8 or later required for this feature. | | -| `-variable_file` | The location of the property file containing the values for variables used in the model. This can also be specified as a comma-separated list of property files, where each successive set of properties layers on top of the previous ones. | | +| `-domain_home` | Required if `-domain_parent` is not used. The full directory and name where the domain should be created. +| `-domain_parent` | Required if `-domain_home` is not used. The parent directory where the domain should be created. The name is the domain name in the model. | | +| `-domain_type` | The type of domain (for example, `WLS`, `JRF`). | `WLS` | +| `-java_home` | The Java home to use for the new domain. If not specified, it defaults to the value of the `JAVA_HOME` environment variable. | | +| `-model_file` | The location of the model file. This can also be specified as a comma-separated list of model locations, where each successive model layers on top of the previous ones. | | +| `-oracle_home` | Home directory of the Oracle WebLogic installation. Required if the `ORACLE_HOME` environment variable is not set. | | +| `-opss_wallet` | The location of the Oracle wallet containing the domain's encryption key required to reconnect to an existing set of RCU schemas. | | +| `-opss_wallet_passphrase_env` | An alternative to entering the OPSS wallet passphrase at a prompt. The value is an environment variable name that WDT will use to retrieve the passphrase. | | +| `-opss_wallet_passphrase_file` | An alternative to entering the OPSS wallet passphrase at a prompt. The value is the name of a file with a string value which WDT will read to retrieve the passphrase. +| `-passphrase_env` | An alternative to entering the encryption passphrase at a prompt. The value is an environment variable name that WDT will use to retrieve the passphrase. | | +| `-passphrase_file` | An alternative to entering the encryption passphrase at a prompt. The value is the name of a file with a string value which WDT will read to retrieve the passphrase. | | +| `-rcu_db` | (deprecated) The RCU database connect string. | | +| `-rcu_prefix` | (deprecated) The RCU prefix to use. | | +| `-rcu_db_user` | (deprecated) The RCU `dbUser` to use. | `sys` | +| `-run_rcu` | Run RCU to create the database schemas specified by the domain type using the specified RCU prefix. Running RCU will drop any existing schemas with the same RCU prefix if they exist prior to trying to create them. | | +| `-use_encryption` | One or more of the passwords in the model or variables file(s) are encrypted and must be decrypted. Java 8 or later required for this feature. | | +| `-variable_file` | The location of the property file containing the values for variables used in the model. This can also be specified as a comma-separated list of property files, where each successive set of properties layers on top of the previous ones. | |