'Checks to make sure the volume has been synchronized
This ensures that all the remote copy targets have been restored
to their natural direction, and all of the volumes have been
fully synchronized.'

def _is_host_ready_for_failback(self, volumes):

    try:
        for volume in volumes:
            if self._volume_of_replicated_type(volume):
                location = volume.get('provider_location')
                remote_rcg_name = self._get_3par_remote_rcg_name(volume['id'], location)
                rcg = self.client.getRemoteCopyGroup(remote_rcg_name)
                targets = rcg['targets']
                for target in targets:
                    if (target['roleReversed'] or (target['state'] != self.RC_GROUP_STARTED)):
                        return False
                volumes = rcg['volumes']
                for volume in volumes:
                    remote_volumes = volume['remoteVolumes']
                    for remote_volume in remote_volumes:
                        if (remote_volume['syncStatus'] != self.SYNC_STATUS_COMPLETED):
                            return False
    except Exception:
        return False
    return True
