'Provide a means to obtain replication targets for a group.
This method is used to find the replication_device config
info. \'backend_id\' is a required key in \'replication_device\'.
Response Example for admin:
.. code:: json
\'replication_targets\': [
\'backend_id\': \'vendor-id-1\',
\'unique_key\': \'val1\',
\'backend_id\': \'vendor-id-2\',
\'unique_key\': \'val2\',
Response example for non-admin:
.. code json
\'replication_targets\': [
\'backend_id\': \'vendor-id-1\'
\'backend_id\': \'vendor-id-2\''

def list_replication_targets(self, ctxt, group):

    replication_targets = []
    try:
        group = objects.Group.get_by_id(ctxt, group.id)
        if self.configuration.replication_device:
            if ctxt.is_admin:
                for rep_dev in self.configuration.replication_device:
                    keys = rep_dev.keys()
                    dev = {}
                    for k in keys:
                        dev[k] = rep_dev[k]
                    replication_targets.append(dev)
            else:
                for rep_dev in self.configuration.replication_device:
                    dev = rep_dev.get('backend_id')
                    if dev:
                        replication_targets.append({'backend_id': dev})
    except exception.GroupNotFound:
        err_msg = (_('Get    replication    targets    failed.    Group    %s    not    found.') % group.id)
        LOG.exception(err_msg)
        raise exception.VolumeBackendAPIException(data=err_msg)
    return {'replication_targets': replication_targets}
