Esempio n. 1
0
def examine_replication_rule(rule_id, issuer, vo='def', session=None):
    """
    Examine a replication rule.

    :param rule_id: The rule_id to get.
    :param issuer: The issuing account of this operation.
    :param vo: The VO of the issuer.
    :param session: The database session in use.
    """
    kwargs = {'rule_id': rule_id}
    if is_multi_vo(
            session=session) and not has_permission(issuer=issuer,
                                                    vo=vo,
                                                    action='access_rule_vo',
                                                    kwargs=kwargs,
                                                    session=session):
        raise AccessDenied('Account %s can not access rules at other VOs.' %
                           (issuer))
    result = rule.examine_rule(rule_id, session=session)
    result = api_update_return_dict(result, session=session)
    if 'transfers' in result:
        result['transfers'] = [
            api_update_return_dict(t, session=session)
            for t in result['transfers']
        ]
    return result
Esempio n. 2
0
def examine_replication_rule(rule_id):
    """
    Examine a replication rule.

    :param rule_id: The rule_id to get.
    """
    return rule.examine_rule(rule_id)
Esempio n. 3
0
def examine_replication_rule(rule_id):
    """
    Examine a replication rule.

    :param rule_id: The rule_id to get.
    """
    result = rule.examine_rule(rule_id)
    result = api_update_return_dict(result)
    if 'transfers' in result:
        result['transfers'] = [api_update_return_dict(t) for t in result['transfers']]
    return result