'Checks to make sure the volumes have been synchronized
This entails ensuring the remote snapshot schedule has been resumed
on the backends and the secondary volume\'s data has been copied back
to the primary.'

def _is_host_ready_for_failback(self, volumes, array_config):

    is_ready = True
    cl = None
    try:
        for volume in volumes:
            if self._volume_of_replicated_type(volume):
                schedule_name = (volume['name'] + (self.REP_SCHEDULE_SUFFIX + '_Pri'))
                cl = self._create_replication_client(array_config)
                schedule = cl.getRemoteSnapshotSchedule(schedule_name)
                schedule = ''.join(schedule)
                result = re.search('.*paused\\s+(\\w+)', schedule)
                is_schedule_active = (result.group(1) == 'false')
                volume_info = cl.getVolumeByName(volume['name'])
                if ((not volume_info['isPrimary']) or (not is_schedule_active)):
                    is_ready = False
                    break
    except Exception as ex:
        LOG.error('There    was    a    problem    when    trying    to    determine    if    the    volume    can    be    failed-back:    %s', ex)
        is_ready = False
    finally:
        self._destroy_replication_client(cl)
    return is_ready
