'Check if a volume is part of an sg and add it if not.
:param serial_number: the array serial number
:param device_id: the device id
:param storagegroup_name: the storage group name
:param volume_name: volume name
:param extra_specs: extra specifications
:returns: msg'

def _check_adding_volume_to_storage_group(self, serial_number, device_id, storagegroup_name, volume_name, extra_specs):

    msg = None
    if self.rest.is_volume_in_storagegroup(serial_number, device_id, storagegroup_name):
        LOG.info('Volume:    %(volume_name)s    is    already    part    of    storage    group    %(sg_name)s.', {'volume_name': volume_name, 'sg_name': storagegroup_name})
    else:
        try:
            self.add_volume_to_storage_group(serial_number, device_id, storagegroup_name, volume_name, extra_specs)
        except Exception as e:
            msg = ('Exception    adding    volume    %(vol)s    to    %(sg)s.    Exception    received    was    %(e)s.' % {'vol': volume_name, 'sg': storagegroup_name, 'e': six.text_type(e)})
            LOG.error(msg)
    return msg
