'Delete the initiator group.
Delete the Initiator group if it has been created by the VMAX driver,
and if there are no masking views associated with it.
:param serial_number: the array serial number
:param initiatorgroup_name: initiator group name
:param host: the short name of the host'

def _last_volume_delete_initiator_group(self, serial_number, initiatorgroup_name, host):

    if (host is not None):
        protocol = self.utils.get_short_protocol_type(self.protocol)
        default_ig_name = ('OS-%(shortHostName)s-%(protocol)s-IG' % {'shortHostName': host, 'protocol': protocol})
        if (initiatorgroup_name == default_ig_name):
            maskingview_names = self.rest.get_masking_views_by_initiator_group(serial_number, initiatorgroup_name)
            if (not maskingview_names):
                @coordination.synchronized('emc-ig-{ig_name}')
                def _delete_ig(ig_name):
                    ig_details = self.rest.get_initiator_group(ig_name)
                    if ig_details:
                        LOG.debug('Last    volume    associated    with    the    initiator    group    -    deleting    the    associated    initiator    group    %(initiatorgroup_name)s.', {'initiatorgroup_name': initiatorgroup_name})
                        self.rest.delete_initiator_group(serial_number, initiatorgroup_name)
                _delete_ig(initiatorgroup_name)
            else:
                LOG.warning("Initiator    group    %(ig_name)s    is    associated    with    masking    views    and    can't    be    deleted.    Number    of    associated    masking    view    is:    %(nmv)d.", {'ig_name': initiatorgroup_name, 'nmv': len(maskingview_names)})
        else:
            LOG.warning('Initiator    group    %(ig_name)s    was    not    created    by    the    VMAX    driver    so    will    not    be    deleted    by    the    VMAX    driver.', {'ig_name': initiatorgroup_name})
    else:
        LOG.warning('Cannot    get    host    name    from    connector    object    -    initiator    group    %(ig_name)s    will    not    be    deleted.', {'ig_name': initiatorgroup_name})
