Exemplo n.º 1
0
def register_groups(monitor, options, config):
    """ register SCST groups
    """
    for (group_name, g) in group.read_all_groups(monitor).items():
        try:
            if not group_name == "Default":
                # The Default group is always there
                scst.add_group(group_name)
            for pattern in g.initiator_pattern():
                scst.add_initiator_pattern_to_group(pattern, group_name)

            log_verbose(options, "Group %s registered" % group_name)
        except scst.ScstException as e:
            handle_exception(options, e)
Exemplo n.º 2
0
def unregister_groups(monitor, options, config):
    """ unregisters the groups of the dedupv1d
    """
    for (group_name, g) in group.read_all_groups(monitor).items():
        try:
            for pattern in g.initiator_pattern():
                scst.rm_initiator_pattern_from_group(pattern, group_name)
            if not group_name == "Default" and scst.exists_group(group_name):
                # The Default group cannot be deleted
                scst.rm_group(group_name)

            log_verbose(options, "Group %s unregistered" % group_name)
        except scst.ScstException as e:
            handle_exception(options, e)