'Delete volume setting (HostAffinity, CopySession) on ETERNUS.'

@lockutils.synchronized('ETERNUS-vol', 'cinder-', True)
def _delete_volume_setting(self, volume):

    LOG.debug('_delete_volume_setting,    volume    id:    %s.', volume['id'])
    volumename = self._create_volume_name(volume['id'])
    vol_instance = self._find_lun(volume)
    if (vol_instance is None):
        LOG.info('_delete_volume_setting,    volumename:%(volumename)s,    volume    not    found    on    ETERNUS.', {'volumename': volumename})
        return False
    self._unmap_lun(volume, None, force=True)
    cpsessionlist = self._find_copysession(vol_instance)
    delete_copysession_list = []
    wait_copysession_list = []
    for cpsession in cpsessionlist:
        LOG.debug('_delete_volume_setting,    volumename:    %(volumename)s,    cpsession:    %(cpsession)s.', {'volumename': volumename, 'cpsession': cpsession})
        if (cpsession['SyncedElement'] == vol_instance.path):
            delete_copysession_list.append(cpsession)
        elif (cpsession['SystemElement'] == vol_instance.path):
            wait_copysession_list.append(cpsession)
    LOG.debug('_delete_volume_setting,    wait_cpsession:    %(wait_cpsession)s,    delete_cpsession:    %(delete_cpsession)s.', {'wait_cpsession': wait_copysession_list, 'delete_cpsession': delete_copysession_list})
    for cpsession in wait_copysession_list:
        self._wait_for_copy_complete(cpsession)
    for cpsession in delete_copysession_list:
        self._delete_copysession(cpsession)
    LOG.debug('_delete_volume_setting,    wait_cpsession:    %(wait_cpsession)s,    delete_cpsession:    %(delete_cpsession)s,    complete.', {'wait_cpsession': wait_copysession_list, 'delete_cpsession': delete_copysession_list})
    return True
