示例#1
0
def _add_options(curr_options, new_options):
    ignore = ['hardware_handler', 'pg_timeout', 'product', 'unpriv_sgio',
              'product_blacklist', 'revision', 'vendor']
    for opt_name, opt_value in new_options:
        if opt_name in ignore:
            continue
        if opt_name == 'detect_path_checker':
            opt_name = 'detect_checker'
        if not _change_existing_option(curr_options, opt_name, opt_value):
            curr_options.append(MultipathConfigOption(name=opt_name,
                                                      value=opt_value))
示例#2
0
def _fix_qinp_options(options):
    have_npr = False
    need_npr = False
    for option in options:
        if option.name == 'features' and 'queue_if_no_path' in option.value:
            option.value = _remove_qinp(option.value)
            need_npr = True
        if option.name == 'no_path_retry':
            have_npr = True
    if need_npr and not have_npr:
        options.append(MultipathConfigOption(name='no_path_retry',
                                             value='queue'))
示例#3
0
def test_config_unimportant(current_actor_context):
    option = MultipathConfigOption(name='path_checker', value='rdac')
    config = MultipathConfig(pathname='unimportant.conf',
                             hw_str_match_exists=True,
                             ignore_new_boot_devs_exists=True,
                             new_bindings_in_boot_exists=True,
                             unpriv_sgio_exists=True,
                             detect_path_checker_exists=True,
                             overrides_hwhandler_exists=True,
                             overrides_pg_timeout_exists=True,
                             queue_if_no_path_exists=True,
                             all_devs_section_exists=True,
                             all_devs_options=[option])
    facts = MultipathConfFacts(configs=[config])

    current_actor_context.feed(facts)
    current_actor_context.run()
    assert not current_actor_context.consume(Report)
示例#4
0
def build_config(val):
    all_devs_options_val = []
    for name_val, value_val in val[16]:
        option = MultipathConfigOption(name=name_val, value=value_val)
        all_devs_options_val.append(option)
    return MultipathConfig(pathname=val[0],
                           default_path_checker=val[1],
                           config_dir=val[2],
                           default_retain_hwhandler=val[3],
                           default_detect_prio=val[4],
                           default_detect_checker=val[5],
                           reassign_maps=val[6],
                           hw_str_match_exists=val[7],
                           ignore_new_boot_devs_exists=val[8],
                           new_bindings_in_boot_exists=val[9],
                           unpriv_sgio_exists=val[10],
                           detect_path_checker_exists=val[11],
                           overrides_hwhandler_exists=val[12],
                           overrides_pg_timeout_exists=val[13],
                           queue_if_no_path_exists=val[14],
                           all_devs_section_exists=val[15],
                           all_devs_options=all_devs_options_val)