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)

    __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)

    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

    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
Exemple #2
0
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 create_typedef(program_name, argument_map):
    """
    Create a domain typedef object for use with a model context.
    :param program_name: the program name, used for logging
    :param argument_map: the argument map that may contain a domain type
    :return: a typedef object
    """
    domain_type = dictionary_utils.get_element(
        argument_map, CommandLineArgUtil.DOMAIN_TYPE_SWITCH)
    if domain_type is None:
        domain_type = 'WLS'
    return DomainTypedef(program_name, domain_type)