def __process_args(args): """ Process the command-line arguments and prompt the user for any missing information :param args: the command-line arguments list :raises CLAException: if an error occurs while validating and processing the command-line arguments """ global __wlst_mode cla_util = CommandLineArgUtil(_program_name, __required_arguments, __optional_arguments) cla_util.set_allow_multiple_models(True) required_arg_map, optional_arg_map = cla_util.process_args(args) cla_helper.verify_required_args_present(_program_name, __required_arguments, required_arg_map) cla_helper.validate_optional_archive(_program_name, optional_arg_map) cla_helper.validate_model_present(_program_name, optional_arg_map) cla_helper.validate_variable_file_exists(_program_name, optional_arg_map) __wlst_mode = cla_helper.process_online_args(optional_arg_map) cla_helper.process_encryption_args(optional_arg_map) combined_arg_map = optional_arg_map.copy() combined_arg_map.update(required_arg_map) return model_context_helper.create_context(_program_name, combined_arg_map)
def __process_args(args): """ Process the command-line arguments. :param args: the command-line arguments list :raises CLAException: if an error occurs while validating and processing the command-line arguments """ _method_name = '__process_args' cla_util = CommandLineArgUtil(_program_name, __required_arguments, __optional_arguments) required_arg_map, optional_arg_map = cla_util.process_args(args, trailing_arg_count=1) cla_helper.verify_required_args_present(_program_name, __required_arguments, required_arg_map) combined_arg_map = optional_arg_map.copy() combined_arg_map.update(required_arg_map) # zero or one output type arguments should be set found = False for key in __output_types: if key in combined_arg_map: if found: types_text = ', '.join(__output_types) ex = exception_helper.create_cla_exception('WLSDPLY-10100', types_text) ex.setExitCode(CommandLineArgUtil.USAGE_ERROR_EXIT_CODE) __logger.throwing(ex, class_name=_class_name, method_name=_method_name) raise ex found = True return model_context_helper.create_context(_program_name, combined_arg_map)
def __process_args(args): """ Process the command-line arguments and prompt the user for any missing information :param args: the command-line arguments list :raises CLAException: if an error occurs while validating and processing the command-line arguments """ cla_util = CommandLineArgUtil(_program_name, __required_arguments, __optional_arguments) cla_util.set_allow_multiple_models(True) required_arg_map, optional_arg_map = cla_util.process_args( args, TOOL_TYPE_CREATE) __verify_required_args_present(required_arg_map) __process_java_home_arg(optional_arg_map) __process_domain_location_args(optional_arg_map) __process_model_args(optional_arg_map) # # Verify that the domain type is a known type and load its typedef. # domain_typedef = model_context_helper.create_typedef( _program_name, required_arg_map) __process_rcu_args(optional_arg_map, domain_typedef.get_domain_type(), domain_typedef) __process_encryption_args(optional_arg_map) __process_opss_args(optional_arg_map) combined_arg_map = optional_arg_map.copy() combined_arg_map.update(required_arg_map) return model_context_helper.create_context(_program_name, combined_arg_map, domain_typedef)
def __process_args(args): """ Process the command-line arguments and prompt the user for any missing information :param args: the command-line arguments list :raises CLAException: if an error occurs while validating and processing the command-line arguments """ cla_util = CommandLineArgUtil(_program_name, __required_arguments, __optional_arguments) required_arg_map, optional_arg_map = cla_util.process_args(args, True) __verify_required_args_present(required_arg_map) __process_java_home_arg(optional_arg_map) __process_domain_location_args(optional_arg_map) __process_model_args(optional_arg_map) # # Verify that the domain type is a known type and load its typedef. # domain_type = required_arg_map[CommandLineArgUtil.DOMAIN_TYPE_SWITCH] domain_typedef = DomainTypedef(_program_name, domain_type) optional_arg_map[CommandLineArgUtil.DOMAIN_TYPEDEF] = domain_typedef __process_rcu_args(optional_arg_map, domain_type, domain_typedef) __process_encryption_args(optional_arg_map) combined_arg_map = optional_arg_map.copy() combined_arg_map.update(required_arg_map) model_context = ModelContext(_program_name, combined_arg_map) domain_typedef.set_model_context(model_context) return model_context
def __process_args(args): """ Process the command-line arguments and prompt the user for any missing information :param args: the command-line arguments list :raises CLAException: if an error occurs while validating and processing the command-line arguments """ global __wlst_mode cla_util = CommandLineArgUtil(_program_name, __required_arguments, __optional_arguments) required_arg_map, optional_arg_map = cla_util.process_args(args) domain_type = dictionary_utils.get_element( optional_arg_map, CommandLineArgUtil.DOMAIN_TYPE_SWITCH) if domain_type is None: domain_type = 'WLS' domain_typedef = DomainTypedef(_program_name, domain_type) optional_arg_map[CommandLineArgUtil.DOMAIN_TYPEDEF] = domain_typedef __verify_required_args_present(required_arg_map) __wlst_mode = __process_online_args(optional_arg_map) __process_archive_filename_arg(required_arg_map) __process_variable_filename_arg(optional_arg_map) combined_arg_map = optional_arg_map.copy() combined_arg_map.update(required_arg_map) return ModelContext(_program_name, combined_arg_map)
def __process_args(args): """ Process the command-line arguments and prompt the user for any missing information :param args: the command-line arguments list :raises CLAException: if an error occurs while validating and processing the command-line arguments """ cla_util = CommandLineArgUtil(_program_name, __required_arguments, __optional_arguments) cla_util.set_allow_multiple_models(True) argument_map = cla_util.process_args(args, TOOL_TYPE_CREATE) __process_java_home_arg(argument_map) __process_domain_location_args(argument_map) # don't verify that the archive is valid until it is needed. # this requirement is specific to create, other tools will verify it. cla_helper.validate_model_present(_program_name, argument_map) cla_helper.validate_variable_file_exists(_program_name, argument_map) # # Verify that the domain type is a known type and load its typedef. # domain_typedef = model_context_helper.create_typedef( _program_name, argument_map) __process_rcu_args(argument_map, domain_typedef.get_domain_type(), domain_typedef) cla_helper.process_encryption_args(argument_map) __process_opss_args(argument_map) return model_context_helper.create_context(_program_name, argument_map, domain_typedef)
def __process_args(args): """ Process the command-line arguments and prompt the user for any missing information :param args: the command-line arguments list :raises CLAException: if an error occurs while validating and processing the command-line arguments """ cla_util = CommandLineArgUtil(_program_name, __required_arguments, __optional_arguments) cla_util.set_allow_multiple_models(True) required_arg_map, optional_arg_map = cla_util.process_args( args, TOOL_TYPE_EXTRACT) cla_helper.verify_required_args_present(_program_name, __required_arguments, required_arg_map) cla_helper.validate_optional_archive(_program_name, optional_arg_map) # determine if the model file was passed separately or requires extraction from the archive. cla_helper.validate_model_present(_program_name, optional_arg_map) cla_helper.validate_variable_file_exists(_program_name, optional_arg_map) cla_helper.process_encryption_args(optional_arg_map) combined_arg_map = optional_arg_map.copy() combined_arg_map.update(required_arg_map) return model_context_helper.create_context(_program_name, combined_arg_map)
def __process_args(args): """ Process the command-line arguments and prompt the user for any missing information :param args: the command-line arguments list :raises CLAException: if an error occurs while validating and processing the command-line arguments """ _method_name = '__process_args' cla_util = CommandLineArgUtil(_program_name, __required_arguments, __optional_arguments) required_arg_map, optional_arg_map = cla_util.process_args(args) __verify_required_args_present(required_arg_map) __validate_mode_args(optional_arg_map) __process_passphrase_arg(optional_arg_map) # # Prompt for the password to encrypt if the -manual switch was specified # if CommandLineArgUtil.ENCRYPT_MANUAL_SWITCH in optional_arg_map and \ CommandLineArgUtil.ONE_PASS_SWITCH not in optional_arg_map: try: pwd = getcreds.getpass('WLSDPLY-04200') except IOException, ioe: ex = exception_helper.create_encryption_exception( 'WLSDPLY-04201', ioe.getLocalizedMessage(), error=ioe) __logger.throwing(ex, class_name=_class_name, method_name=_method_name) raise ex optional_arg_map[CommandLineArgUtil.ONE_PASS_SWITCH] = String(pwd)
def __process_args(args): """ Process the command-line arguments. :param args: the command-line arguments list :raises CLAException: if an error occurs while validating and processing the command-line arguments """ _method_name = '__process_args' cla_util = CommandLineArgUtil(_program_name, __required_arguments, __optional_arguments) argument_map = cla_util.process_args(args, trailing_arg_count=2) return ModelContext(_program_name, argument_map)
def __process_args(args): """ Process the command-line arguments and prompt the user for any missing information :param args: the command-line arguments list :raises CLAException: if an error occurs while validating and processing the command-line arguments """ cla_util = CommandLineArgUtil(_program_name, __required_arguments, __optional_arguments) cla_util.set_allow_multiple_models(True) argument_map = cla_util.process_args(args) __process_model_args(argument_map) return model_context_helper.create_context(_program_name, argument_map)
def __process_args(args): """ Process the command-line arguments and prompt the user for any missing information :param args: the command-line arguments list :raises CLAException: if an error occurs while validating and processing the command-line arguments """ global __wlst_mode cla_util = CommandLineArgUtil(_program_name, __required_arguments, __optional_arguments) argument_map = cla_util.process_args(args) # determine if the model file was passed separately or requires extraction from the archive. cla_helper.validate_model_present(_program_name, argument_map) return model_context_helper.create_context(_program_name, argument_map)
def __process_args(args): """ Process the command-line arguments. :param args: the command-line arguments list :raises CLAException: if an error occurs while validating and processing the command-line arguments """ _method_name = '__process_args' cla_util = CommandLineArgUtil(_program_name, __required_arguments, __optional_arguments) cla_util.set_allow_multiple_models(True) argument_map = cla_util.process_args(args) target_configuration_helper.process_target_arguments(argument_map) return ModelContext(_program_name, argument_map)
def __process_args(args): """ Process the command-line arguments and prompt the user for any missing information :param args: the command-line arguments list :raises CLAException: if an error occurs while validating and processing the command-line arguments """ cla_util = CommandLineArgUtil(_program_name, __required_arguments, __optional_arguments) cla_util.set_allow_multiple_models(True) required_arg_map, optional_arg_map = cla_util.process_args(args) __verify_required_args_present(required_arg_map) __process_model_args(optional_arg_map) __process_print_usage_args(optional_arg_map) combined_arg_map = optional_arg_map.copy() combined_arg_map.update(required_arg_map) return ModelContext(_program_name, combined_arg_map)
def __process_args(args): """ Process the command-line arguments and prompt the user for any missing information :param args: the command-line arguments list :raises CLAException: if an error occurs while validating and processing the command-line arguments """ global __wlst_mode cla_util = CommandLineArgUtil(_program_name, __required_arguments, __optional_arguments) argument_map = cla_util.process_args(args) __wlst_mode = cla_helper.process_online_args(argument_map) __process_target_arg(argument_map) __process_archive_filename_arg(argument_map) __process_variable_filename_arg(argument_map) __process_java_home(argument_map) return model_context_helper.create_context(_program_name, argument_map)
def __process_args(args): """ Process the command-line arguments and prompt the user for any missing information :param args: the command-line arguments list :raises CLAException: if an error occurs while validating and processing the command-line arguments """ global __wlst_mode cla_util = CommandLineArgUtil(_program_name, __required_arguments, __optional_arguments) required_arg_map, optional_arg_map = cla_util.process_args(args) __process_model_args(optional_arg_map) __process_injector_file(optional_arg_map) __process_keywords_file(optional_arg_map) __process_properties_file(optional_arg_map) combined_arg_map = optional_arg_map.copy() combined_arg_map.update(required_arg_map) return model_context_helper.create_context(_program_name, combined_arg_map)
def __process_args(args): """ Process the command-line arguments. :param args: the command-line arguments list :raises CLAException: if an error occurs while validating and processing the command-line arguments """ _method_name = '__process_args' cla_util = CommandLineArgUtil(_program_name, __required_arguments, __optional_arguments) required_arg_map, optional_arg_map = cla_util.process_args( args, trailing_arg_count=2) cla_helper.verify_required_args_present(_program_name, __required_arguments, required_arg_map) combined_arg_map = optional_arg_map.copy() combined_arg_map.update(required_arg_map) return ModelContext(_program_name, combined_arg_map)
def __process_args(args): """ Process the command-line arguments and prompt the user for any missing information :param args: the command-line arguments list :raises CLAException: if an error occurs while validating and processing the command-line arguments """ global __wlst_mode cla_util = CommandLineArgUtil(_program_name, __required_arguments, __optional_arguments) required_arg_map, optional_arg_map = cla_util.process_args(args) __verify_required_args_present(required_arg_map) __process_model_args(optional_arg_map) __wlst_mode = __process_online_args(optional_arg_map) __process_encryption_args(optional_arg_map) combined_arg_map = optional_arg_map.copy() combined_arg_map.update(required_arg_map) return ModelContext(_program_name, combined_arg_map)
def __process_args(args): """ Process the command-line arguments and prompt the user for any missing information :param args: the command-line arguments list :raises CLAException: if an error occurs while validating and processing the command-line arguments """ global __wlst_mode cla_util = CommandLineArgUtil(_program_name, __required_arguments, __optional_arguments) required_arg_map, optional_arg_map = cla_util.process_args(args) cla_helper.verify_required_args_present(_program_name, __required_arguments, required_arg_map) # determine if the model file was passed separately or requires extraction from the archive. cla_helper.validate_model_present(_program_name, optional_arg_map) __process_injector_file(optional_arg_map) __process_keywords_file(optional_arg_map) __process_properties_file(optional_arg_map) combined_arg_map = optional_arg_map.copy() combined_arg_map.update(required_arg_map) return model_context_helper.create_context(_program_name, combined_arg_map)
def __process_args(args): """ Process the command-line arguments and prompt the user for any missing information :param args: the command-line arguments list :raises CLAException: if an error occurs while validating and processing the command-line arguments """ cla_util = CommandLineArgUtil(_program_name, __required_arguments, __optional_arguments) cla_util.set_allow_multiple_models(True) argument_map = cla_util.process_args(args, TOOL_TYPE_EXTRACT) cla_helper.validate_optional_archive(_program_name, argument_map) # determine if the model file was passed separately or requires extraction from the archive. cla_helper.validate_model_present(_program_name, argument_map) cla_helper.validate_variable_file_exists(_program_name, argument_map) cla_helper.process_encryption_args(argument_map) argument_map[CommandLineArgUtil. VALIDATION_METHOD] = CommandLineArgUtil.LAX_VALIDATION_METHOD model_context = model_context_helper.create_context( _program_name, argument_map) model_context.set_ignore_missing_archive_entries(True) return model_context