diff options
author | Matthias Radestock <matthias@lshift.net> | 2008-07-12 10:20:36 +0100 |
---|---|---|
committer | Matthias Radestock <matthias@lshift.net> | 2008-07-12 10:20:36 +0100 |
commit | 59b0187504a41ea31a7dee3f4442f0a76bf31c50 (patch) | |
tree | 31744111155b604c4f21f4f651e07e71fb55798b | |
parent | 37b37bec445c3af76c8ea9815ffe152e8d4bb6df (diff) | |
download | rabbitmq-server-59b0187504a41ea31a7dee3f4442f0a76bf31c50.tar.gz |
cosmetic
-rw-r--r-- | src/rabbit_realm.erl | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/rabbit_realm.erl b/src/rabbit_realm.erl index dad3deef..7b2d730c 100644 --- a/src/rabbit_realm.erl +++ b/src/rabbit_realm.erl @@ -117,13 +117,13 @@ delete(Realm = #resource{kind = realm}, Resource = #resource{}) -> % This links or unlinks a resource to a realm manage_link(Action, Realm = #resource{kind = realm, name = RealmName}, - Resource = #resource{name = ResourceName}) -> - Table = realm_table_for_resource(Resource), + R = #resource{name = Name}) -> + Table = realm_table_for_resource(R), rabbit_misc:execute_mnesia_transaction( fun () -> case mnesia:read({realm, Realm}) of [] -> mnesia:abort(not_found); - [_] -> Action({Table, RealmName, ResourceName}) + [_] -> Action({Table, RealmName, Name}) end end). @@ -142,8 +142,8 @@ check(#resource{kind = realm, name = Realm}, Resource = #resource{}) -> end. % Requires a mnesia transaction. -delete_from_all(Resource = #resource{name = Name}) -> - mnesia:delete_object({realm_table_for_resource(Resource), '_', Name}). +delete_from_all(R = #resource{name = Name}) -> + mnesia:delete_object({realm_table_for_resource(R), '_', Name}). access_request(Username, Exclusive, Ticket = #ticket{realm_name = RealmName}) when is_binary(Username) -> @@ -232,21 +232,21 @@ preen_realms() -> Resources = [#resource{kind = exchange},#resource{kind = queue}], [preen_realm(Resource) || Resource <- Resources ], ok. -preen_realm(Resource = #resource{}) -> - LinkType = realm_table_for_resource(Resource), +preen_realm(R = #resource{}) -> + LinkType = realm_table_for_resource(R), Cursor = qlc:cursor( qlc:q([L#realm_resource.resource || L <- mnesia:table(LinkType)])), - preen_next(Cursor, LinkType, parent_table_for_resource(Resource)), + preen_next(Cursor, LinkType, parent_table_for_resource(R)), qlc:delete_cursor(Cursor). preen_next(Cursor, LinkType, ParentTable) -> case qlc:next_answers(Cursor, 1) of [] -> ok; - [ResourceName] -> - case mnesia:read({ParentTable, ResourceName}) of + [Name] -> + case mnesia:read({ParentTable, Name}) of [] -> - mnesia:delete_object({LinkType, '_', ResourceName}); + mnesia:delete_object({LinkType, '_', Name}); _ -> ok end, preen_next(Cursor, LinkType, ParentTable) |