Exemplo n.º 1
0
def unregister_groups_direct(options, config):
    """ unregisters the groups configured at SCST. This
	function bypasses the information given by the monitor. Therefore
	this function can be used to unregister the groups if dedupv1d is not
	available
    """
    try:
        for (group_name) in scst.get_scst_groups():
            try:
                if options.verbose:
                    log_info(options, "Remove group %s" % (group_name))
                for ip in scst.get_initiator_pattern_in_group(group_name):
                    scst.rm_initiator_pattern_from_group(ip, group_name)

                for device_name in scst.get_devices_in_group(group_name):
                    scst.rm_from_group(device_name, group_name)

                if group_name != "Default":
                    scst.rm_group(group_name)
            except scst.ScstException as e:
                log_error(options,  "Failed to remove group %s: %s" % (group_name, e))
    except scst.ScstException as e:
        log_error(options, "Failed to remove groups: %s" % (e))
Exemplo n.º 2
0
    def get_devices_in_group(self, group_name):
        """ returns all devices that are registered at SCST
		for a given group
		"""
        return scst.get_devices_in_group(group_name)