'Fail if none of the services could be updated.'

@mock.patch('cinder.volume.rpcapi.VolumeAPI.failover')
def test_failover_api_fail_multiple_results_not_updated(self, failover_mock):

    rep_field = fields.ReplicationStatus
    cluster_name = 'mycluster@backend1'
    cluster = objects.Cluster(self.context, name=cluster_name, replication_status=rep_field.ENABLED, binary=constants.VOLUME_BINARY)
    cluster.create()
    down_time = timeutils.datetime.datetime(1970, 1, 1)
    services = [objects.Service(self.context, host='host1@backend1', cluster_name=cluster_name, replication_status=rep_field.ENABLED, created_at=down_time, updated_at=down_time, modified_at=down_time, binary=constants.VOLUME_BINARY), objects.Service(self.context, host='host2@backend1', cluster_name=cluster_name, replication_status=rep_field.ERROR, binary=constants.VOLUME_BINARY)]
    services[0].create()
    services[1].create()
    self.assertRaises(exception.InvalidInput, self.volume_api.failover, self.context, None, cluster_name, mock.sentinel.secondary_id)
    for service in services:
        svc = objects.Service.get_by_id(self.context, service.id)
        self.assertEqual(service.replication_status, svc.replication_status)
    cluster.refresh()
    self.assertEqual(rep_field.ENABLED, cluster.replication_status)
    failover_mock.assert_not_called()
