def persist_file(model_context, dictionary):
    _method_name = 'persist_file'
    __logger.entering(class_name=CLASS_NAME, method_name=_method_name)
    filename = all_utils.filename(
        generator_helper.filename(), all_utils.str_mode(model_context),
        generator_wlst.wls_version().replace('.', ''))
    __logger.info('WLSDPLYST-01001',
                  all_utils.str_mode(model_context),
                  filename,
                  class_name=CLASS_NAME,
                  method_name=_method_name)
    all_utils.create_json_file(dictionary, filename)
    __logger.exiting(result=filename,
                     class_name=CLASS_NAME,
                     method_name=_method_name)
    return filename
Exemple #2
0
def persist_file(model_context, dictionary):
    """
    Persist the generated online dictionary to the test files location and generated file name.
    :param model_context: containing the test files location
    :param dictionary: generated dictionary
    :return: File name for persisted dictionary
    """
    _method_name = 'persist_file'
    __logger.entering(class_name=CLASS_NAME, method_name=_method_name)
    filename = all_utils.filename(
        generator_helper.filename(), all_utils.str_mode(model_context),
        generator_wlst.wls_version().replace('.', ''))
    __logger.info('WLSDPLYST-01001',
                  all_utils.str_mode(model_context),
                  filename,
                  class_name=CLASS_NAME,
                  method_name=_method_name)
    all_utils.create_json_file(dictionary, filename)
    __logger.exiting(result=filename,
                     class_name=CLASS_NAME,
                     method_name=_method_name)
    return filename
Exemple #3
0
def verify_offline_dictionary(model_context):
    _method_name = 'verify_offline_dictionary'
    __logger.entering(model_context,
                      class_name=CLASS_NAME,
                      method_name=_method_name)
    mode = all_utils.str_mode(model_context)
    __logger.info('WLSDPLYST-01002',
                  mode,
                  class_name=CLASS_NAME,
                  method_name=_method_name)
    offline_dictionary = get_dictionary(model_context)
    errs, warn = Verifier(model_context, offline_dictionary).verify()
    log_status(mode, _method_name, errs, warn)
    __logger.exiting(class_name=CLASS_NAME, method_name=_method_name)
def generate_offline(model_context, online_dictionary):
    _method_name = 'generate_offline'
    __logger.entering(model_context,
                      class_name=CLASS_NAME,
                      method_name=_method_name)
    online_dictionary_copy = copy.deepcopy(online_dictionary)
    __logger.info('WLSDPLYST-01000',
                  all_utils.str_mode(model_context),
                  class_name=CLASS_NAME,
                  method_name=_method_name)
    offline_dictionary = OfflineGenerator(model_context,
                                          online_dictionary_copy).generate()
    persist_file(model_context, offline_dictionary)
    __logger.exiting(class_name=CLASS_NAME, method_name=_method_name)
    return offline_dictionary
Exemple #5
0
def generate_online(model_context):
    """
    Generate the online dictionary describing all the MBeans and MBean attributes for a specific weblogic
    version and WLST mode.
    :param model_context: contains the kwargs and other information
    :return: generated online dictionary
    """
    _method_name = 'generate_online'
    __logger.entering(model_context,
                      class_name=CLASS_NAME,
                      method_name=_method_name)
    online_dictionary = dict()
    __logger.info('WLSDPLYST-01000',
                  all_utils.str_mode(model_context),
                  class_name=CLASS_NAME,
                  method_name=_method_name)
    OnlineGenerator(model_context, online_dictionary).generate()
    persist_file(model_context, online_dictionary)
    __logger.exiting(class_name=CLASS_NAME, method_name=_method_name)
    return online_dictionary