)]}'
{"ironic/api/hooks.py":[{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"aac54d6e240536eb9ef04077228b0e6c163908ab","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"        is_public_api \u003d state.request.environ.get(\u0027is_public_api\u0027, False)"},{"line_number":80,"context_line":"        creds \u003d dict(headers)"},{"line_number":81,"context_line":"        is_admin \u003d policy.get_enforcer().enforce(\u0027admin_api\u0027, creds, creds)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        state.request.context \u003d context.RequestContext("},{"line_number":84,"context_line":"            auth_token\u003dauth_token,"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_137374b5","line":81,"updated":"2014-11-18 17:57:51.000000000","message":"Does enforce() handle keys like X-Tenant-Id the same way that check() previously handled tenant_id? I see below we\u0027re passing the context to enforce() and so it\u0027s using e.g. tenant.\n\nThinking about this more, we absolutely can\u0027t just pass in headers, even if it works. We need to build the entire dict. Using e.g. `curl -H \"is_public_api: True\"` would make every API public.\n\nAlso, why not use the enforce() shortcut method defined in ironic.common?","commit_id":"41bb9fa2f2ee2c8ccf2ce0a6c62d666e4b4d9baa"},{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"c50aaed7fccebf29625c78b103758ddc7de675db","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"        is_public_api \u003d state.request.environ.get(\u0027is_public_api\u0027, False)"},{"line_number":80,"context_line":"        creds \u003d dict(headers)"},{"line_number":81,"context_line":"        is_admin \u003d policy.get_enforcer().enforce(\u0027admin_api\u0027, creds, creds)"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"        state.request.context \u003d context.RequestContext("},{"line_number":84,"context_line":"            auth_token\u003dauth_token,"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_6243fc6c","line":81,"in_reply_to":"5a890539_137374b5","updated":"2014-11-18 20:34:04.000000000","message":"enforce() performs checks that are specified in policy.json. In this case it checks roles.\n\ncurl -H \"is_public_api: True\"`  won\u0027t make the entire API public because this parameter is read from the WSGI environment, not headers. It is explicitly set in AuthToken WSGI middleware https://github.com/openstack/ironic/blob/master/ironic/api/middleware/auth_token.py#L57\n\nHeaders like X-Tenant-Id, X-Roles, etc  are explicitly overwritten by the same middleware so you cannot just set them from the user side","commit_id":"41bb9fa2f2ee2c8ccf2ce0a6c62d666e4b4d9baa"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"aac54d6e240536eb9ef04077228b0e6c163908ab","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        ctx \u003d state.request.context"},{"line_number":110,"context_line":"        enforcer \u003d policy.get_enforcer()"},{"line_number":111,"context_line":"        enforcer.enforce(\u0027trusted_call\u0027, ctx.to_dict(), ctx.to_dict(),"},{"line_number":112,"context_line":"                         do_raise\u003dTrue, exc\u003dexc.HTTPForbidden)"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"class NoExceptionTracebackHook(hooks.PecanHook):"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_d36acc80","line":112,"updated":"2014-11-18 17:57:51.000000000","message":"Why not use the enforce() shortcut method defined in ironic.common?","commit_id":"41bb9fa2f2ee2c8ccf2ce0a6c62d666e4b4d9baa"},{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"c50aaed7fccebf29625c78b103758ddc7de675db","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        ctx \u003d state.request.context"},{"line_number":110,"context_line":"        enforcer \u003d policy.get_enforcer()"},{"line_number":111,"context_line":"        enforcer.enforce(\u0027trusted_call\u0027, ctx.to_dict(), ctx.to_dict(),"},{"line_number":112,"context_line":"                         do_raise\u003dTrue, exc\u003dexc.HTTPForbidden)"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"class NoExceptionTracebackHook(hooks.PecanHook):"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_c23af033","line":112,"in_reply_to":"5a890539_d36acc80","updated":"2014-11-18 20:34:04.000000000","message":"Thanks, nice catch!","commit_id":"41bb9fa2f2ee2c8ccf2ce0a6c62d666e4b4d9baa"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"9d1f3e5696b310b6e136535c085ba3d24707aec4","unresolved":false,"context_lines":[{"line_number":101,"context_line":"class AdminAuthHook(hooks.PecanHook):"},{"line_number":102,"context_line":"    \"\"\"Verify that the user has admin rights."},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    Checks whether the request context is an admin context and"},{"line_number":105,"context_line":"    rejects the request otherwise."},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"5a890539_3c8bdd1f","line":104,"updated":"2014-11-26 17:44:28.000000000","message":"would you mind updating this? \u0027an admin context or a public API (whatever that means), and rejects...\u0027","commit_id":"b4de9faa3976140dc53928511d83004045e3b239"},{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"8e66804051efc2e37d0e027e0ef8fb47afd1d19d","unresolved":false,"context_lines":[{"line_number":101,"context_line":"class AdminAuthHook(hooks.PecanHook):"},{"line_number":102,"context_line":"    \"\"\"Verify that the user has admin rights."},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    Checks whether the request context is an admin context and"},{"line_number":105,"context_line":"    rejects the request otherwise."},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_76f7128d","line":104,"in_reply_to":"5a890539_3c8bdd1f","updated":"2014-12-16 23:16:43.000000000","message":"Done","commit_id":"b4de9faa3976140dc53928511d83004045e3b239"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"9bf87c2143eb28ae8acfa721d9ac2dc5de074cfb","unresolved":false,"context_lines":[{"line_number":102,"context_line":"    \"\"\"Verify that the user has admin rights."},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    Checks whether the API call is performed against a public"},{"line_number":105,"context_line":"    resourse or the user has admin privileges in the appropriate"},{"line_number":106,"context_line":"    tennant, domain or other administrative unit."},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_73a472b9","line":105,"updated":"2014-12-17 11:32:06.000000000","message":"s/resourse/resource","commit_id":"0276d5a39710b4ff9d5e88b843cdaf221e96c48a"},{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"3fd6602fec85b9afae244f84f176935320b6cf97","unresolved":false,"context_lines":[{"line_number":102,"context_line":"    \"\"\"Verify that the user has admin rights."},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    Checks whether the API call is performed against a public"},{"line_number":105,"context_line":"    resourse or the user has admin privileges in the appropriate"},{"line_number":106,"context_line":"    tennant, domain or other administrative unit."},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_5132a7a7","line":105,"in_reply_to":"3a961159_73a472b9","updated":"2014-12-21 01:43:46.000000000","message":"Done","commit_id":"0276d5a39710b4ff9d5e88b843cdaf221e96c48a"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"9bf87c2143eb28ae8acfa721d9ac2dc5de074cfb","unresolved":false,"context_lines":[{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    Checks whether the API call is performed against a public"},{"line_number":105,"context_line":"    resourse or the user has admin privileges in the appropriate"},{"line_number":106,"context_line":"    tennant, domain or other administrative unit."},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    \"\"\""},{"line_number":109,"context_line":"    def before(self, state):"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_538f7623","line":106,"updated":"2014-12-17 11:32:06.000000000","message":"s/tennant/tenant","commit_id":"0276d5a39710b4ff9d5e88b843cdaf221e96c48a"},{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"3fd6602fec85b9afae244f84f176935320b6cf97","unresolved":false,"context_lines":[{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    Checks whether the API call is performed against a public"},{"line_number":105,"context_line":"    resourse or the user has admin privileges in the appropriate"},{"line_number":106,"context_line":"    tennant, domain or other administrative unit."},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    \"\"\""},{"line_number":109,"context_line":"    def before(self, state):"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_71232358","line":106,"in_reply_to":"3a961159_538f7623","updated":"2014-12-21 01:43:46.000000000","message":"Done","commit_id":"0276d5a39710b4ff9d5e88b843cdaf221e96c48a"}],"ironic/common/context.py":[{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"fcc1fd503600eaf8ee220689ad9c4d2738e2731a","unresolved":false,"context_lines":[{"line_number":34,"context_line":"                                             user\u003duser, tenant\u003dtenant,"},{"line_number":35,"context_line":"                                             is_admin\u003dis_admin,"},{"line_number":36,"context_line":"                                             read_only\u003dread_only,"},{"line_number":37,"context_line":"                                             request_id\u003drequest_id)"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        self.is_public_api \u003d is_public_api"},{"line_number":40,"context_line":"        self.domain_id \u003d domain_id"}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_cbb9787a","line":37,"updated":"2014-10-07 09:04:18.000000000","message":"Why we dropped show_deleted? It\u0027s a bit weird that we receive it as parameter but we are not using it.\n\nI thought it was because the oslo RequestContext have dropped it but that doesn\u0027t seem to be the case[1]\n\n[1] https://github.com/openstack/oslo-incubator/blob/master/openstack/common/context.py#L53","commit_id":"5e5bd8530d777f66a53e85b2453e3ce5f85625e0"},{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"bcabd8d0ab11f6973eba7f4b9963d06d7cdc1de1","unresolved":false,"context_lines":[{"line_number":34,"context_line":"                                             user\u003duser, tenant\u003dtenant,"},{"line_number":35,"context_line":"                                             is_admin\u003dis_admin,"},{"line_number":36,"context_line":"                                             read_only\u003dread_only,"},{"line_number":37,"context_line":"                                             request_id\u003drequest_id)"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"        self.is_public_api \u003d is_public_api"},{"line_number":40,"context_line":"        self.domain_id \u003d domain_id"}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_5a62ac3e","line":37,"in_reply_to":"baa201ad_cbb9787a","updated":"2014-10-07 12:11:06.000000000","message":"I thought that it\u0027s reasonable not to expose this parameter because Ironic does not support this feature.","commit_id":"5e5bd8530d777f66a53e85b2453e3ce5f85625e0"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"fcc1fd503600eaf8ee220689ad9c4d2738e2731a","unresolved":false,"context_lines":[{"line_number":47,"context_line":"                \u0027tenant\u0027: self.tenant,"},{"line_number":48,"context_line":"                \u0027is_admin\u0027: self.is_admin,"},{"line_number":49,"context_line":"                \u0027read_only\u0027: self.read_only,"},{"line_number":50,"context_line":"                \u0027show_deleted\u0027: self.show_deleted,"},{"line_number":51,"context_line":"                \u0027request_id\u0027: self.request_id,"},{"line_number":52,"context_line":"                \u0027domain_id\u0027: self.domain_id,"},{"line_number":53,"context_line":"                \u0027roles\u0027: self.roles,"}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_4b7ca8b5","line":50,"updated":"2014-10-07 09:04:18.000000000","message":"Also it would make it odd if we keep it here and drop it up there... Imagine somone pass show_deleted\u003dTrue to the context but here it will return False cause that haven\u0027t been used","commit_id":"5e5bd8530d777f66a53e85b2453e3ce5f85625e0"},{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"bcabd8d0ab11f6973eba7f4b9963d06d7cdc1de1","unresolved":false,"context_lines":[{"line_number":47,"context_line":"                \u0027tenant\u0027: self.tenant,"},{"line_number":48,"context_line":"                \u0027is_admin\u0027: self.is_admin,"},{"line_number":49,"context_line":"                \u0027read_only\u0027: self.read_only,"},{"line_number":50,"context_line":"                \u0027show_deleted\u0027: self.show_deleted,"},{"line_number":51,"context_line":"                \u0027request_id\u0027: self.request_id,"},{"line_number":52,"context_line":"                \u0027domain_id\u0027: self.domain_id,"},{"line_number":53,"context_line":"                \u0027roles\u0027: self.roles,"}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_3ae08895","line":50,"in_reply_to":"baa201ad_4b7ca8b5","updated":"2014-10-07 12:11:06.000000000","message":"I put my comment about show_deleted ^.\n\nIt\u0027s possible to do super().to_dict().extend(our_dict) in order to be more consistent with the oslo context.","commit_id":"5e5bd8530d777f66a53e85b2453e3ce5f85625e0"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"9d1f3e5696b310b6e136535c085ba3d24707aec4","unresolved":false,"context_lines":[{"line_number":28,"context_line":"        :param domain_name: The name of the domain."},{"line_number":29,"context_line":"        :param is_public_api: Specifies whether the request should be processed"},{"line_number":30,"context_line":"                              without authentication."},{"line_number":31,"context_line":"        :param roles: User\u0027s roles."},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"        \"\"\""},{"line_number":34,"context_line":"        self.is_public_api \u003d is_public_api"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a890539_1cb461d3","line":31,"updated":"2014-11-26 17:44:28.000000000","message":"nit: list of user\u0027s roles if any.","commit_id":"b4de9faa3976140dc53928511d83004045e3b239"},{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"8e66804051efc2e37d0e027e0ef8fb47afd1d19d","unresolved":false,"context_lines":[{"line_number":28,"context_line":"        :param domain_name: The name of the domain."},{"line_number":29,"context_line":"        :param is_public_api: Specifies whether the request should be processed"},{"line_number":30,"context_line":"                              without authentication."},{"line_number":31,"context_line":"        :param roles: User\u0027s roles."},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"        \"\"\""},{"line_number":34,"context_line":"        self.is_public_api \u003d is_public_api"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_16cc0e35","line":31,"in_reply_to":"5a890539_1cb461d3","updated":"2014-12-16 23:16:43.000000000","message":"Done","commit_id":"b4de9faa3976140dc53928511d83004045e3b239"}],"ironic/common/policy.py":[{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"fcc1fd503600eaf8ee220689ad9c4d2738e2731a","unresolved":false,"context_lines":[{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"# TODO(romcheg): Since the enforcer is lazy-initialized on the first"},{"line_number":27,"context_line":"#                API call this shold be made thread safe."},{"line_number":28,"context_line":"def _init_enforcer(policy_file\u003dNone, rules\u003dNone,"},{"line_number":29,"context_line":"                   default_rule\u003dNone, use_conf\u003dTrue):"},{"line_number":30,"context_line":"    \"\"\"Init an Enforcer class."}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_eede4a6c","line":27,"updated":"2014-10-07 09:04:18.000000000","message":"Hmm... it looks fine... afaict.","commit_id":"5e5bd8530d777f66a53e85b2453e3ce5f85625e0"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"6e5fbafaf29069f1c7c9851a89d2a5ef0502f046","unresolved":false,"context_lines":[{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"# TODO(romcheg): Since the enforcer is lazy-initialized on the first"},{"line_number":27,"context_line":"#                API call this shold be made thread safe."},{"line_number":28,"context_line":"def _init_enforcer(policy_file\u003dNone, rules\u003dNone,"},{"line_number":29,"context_line":"                   default_rule\u003dNone, use_conf\u003dTrue):"},{"line_number":30,"context_line":"    \"\"\"Init an Enforcer class."}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_b829e19c","line":27,"in_reply_to":"baa201ad_7a9cd00f","updated":"2014-10-07 12:52:25.000000000","message":"nothing horrible IMO. one object will be shadowed by another, but it looks like it won\u0027t bring troubles","commit_id":"5e5bd8530d777f66a53e85b2453e3ce5f85625e0"},{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"22f453cfde3992e60c2904ccadd4b046342a1f25","unresolved":false,"context_lines":[{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"# TODO(romcheg): Since the enforcer is lazy-initialized on the first"},{"line_number":27,"context_line":"#                API call this shold be made thread safe."},{"line_number":28,"context_line":"def _init_enforcer(policy_file\u003dNone, rules\u003dNone,"},{"line_number":29,"context_line":"                   default_rule\u003dNone, use_conf\u003dTrue):"},{"line_number":30,"context_line":"    \"\"\"Init an Enforcer class."}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_a9498a32","line":27,"in_reply_to":"baa201ad_b829e19c","updated":"2014-10-07 20:02:10.000000000","message":"That\u0027s actually why I didn\u0027t put any lock here. This is definitely a good place for a race condition but nothing terrible should happen.\n\nI think now the optimal solution is to leave it as is but put a comment that this is a place with a race condition which should be safe.","commit_id":"5e5bd8530d777f66a53e85b2453e3ce5f85625e0"},{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"bcabd8d0ab11f6973eba7f4b9963d06d7cdc1de1","unresolved":false,"context_lines":[{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"# TODO(romcheg): Since the enforcer is lazy-initialized on the first"},{"line_number":27,"context_line":"#                API call this shold be made thread safe."},{"line_number":28,"context_line":"def _init_enforcer(policy_file\u003dNone, rules\u003dNone,"},{"line_number":29,"context_line":"                   default_rule\u003dNone, use_conf\u003dTrue):"},{"line_number":30,"context_line":"    \"\"\"Init an Enforcer class."}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_7a9cd00f","line":27,"in_reply_to":"baa201ad_eede4a6c","updated":"2014-10-07 12:11:06.000000000","message":"But what if two simultaneous requests come here and try initialising the enforcer?","commit_id":"5e5bd8530d777f66a53e85b2453e3ce5f85625e0"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"fcc1fd503600eaf8ee220689ad9c4d2738e2731a","unresolved":false,"context_lines":[{"line_number":51,"context_line":"    if not _ENFORCER:"},{"line_number":52,"context_line":"        _init_enforcer()"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    return _ENFORCER"}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_ce126608","line":54,"updated":"2014-10-07 09:04:18.000000000","message":"SUGGESTION: \n\nMaybe transforming this method in a more convenient one, I see that on the code we always do:\n\n policy.get_enforcer().enforce(...)\n\nMaybe having something like:\n\n def enforce(param, param param):\n     if not _ENFORCER:\n         _init_enforcer()\n\n     _ENFORCER.enforce(param, param, param)\n\nso in the code you just call policy.enforce(...)","commit_id":"5e5bd8530d777f66a53e85b2453e3ce5f85625e0"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"6e5fbafaf29069f1c7c9851a89d2a5ef0502f046","unresolved":false,"context_lines":[{"line_number":51,"context_line":"    if not _ENFORCER:"},{"line_number":52,"context_line":"        _init_enforcer()"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    return _ENFORCER"}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_d81b057f","line":54,"in_reply_to":"baa201ad_7a1930d6","updated":"2014-10-07 12:52:25.000000000","message":"+1 for having both","commit_id":"5e5bd8530d777f66a53e85b2453e3ce5f85625e0"},{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"bcabd8d0ab11f6973eba7f4b9963d06d7cdc1de1","unresolved":false,"context_lines":[{"line_number":51,"context_line":"    if not _ENFORCER:"},{"line_number":52,"context_line":"        _init_enforcer()"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    return _ENFORCER"}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_7a1930d6","line":54,"in_reply_to":"baa201ad_ce126608","updated":"2014-10-07 12:11:06.000000000","message":"I like this suggestion and will add this function in the next patch set.\n\nHowever I also think it\u0027s reasonable to leave the get_enforcer() function as well because it allows to access and configure enforcer.","commit_id":"5e5bd8530d777f66a53e85b2453e3ce5f85625e0"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"aac54d6e240536eb9ef04077228b0e6c163908ab","unresolved":false,"context_lines":[{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"# TODO(romcheg): Since the enforcer is lazy-initialized on the first"},{"line_number":27,"context_line":"#                API call this shold be made thread safe."},{"line_number":28,"context_line":"def _init_enforcer(policy_file\u003dNone, rules\u003dNone,"},{"line_number":29,"context_line":"                   default_rule\u003dNone, use_conf\u003dTrue):"},{"line_number":30,"context_line":"    \"\"\"Init an Enforcer class."}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_f3b98816","line":27,"updated":"2014-11-18 17:57:51.000000000","message":"I feel like this should be handled and not a TODO... just needs a quick lock.","commit_id":"41bb9fa2f2ee2c8ccf2ce0a6c62d666e4b4d9baa"},{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"c50aaed7fccebf29625c78b103758ddc7de675db","unresolved":false,"context_lines":[{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"# TODO(romcheg): Since the enforcer is lazy-initialized on the first"},{"line_number":27,"context_line":"#                API call this shold be made thread safe."},{"line_number":28,"context_line":"def _init_enforcer(policy_file\u003dNone, rules\u003dNone,"},{"line_number":29,"context_line":"                   default_rule\u003dNone, use_conf\u003dTrue):"},{"line_number":30,"context_line":"    \"\"\"Init an Enforcer class."}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_62593c8e","line":27,"in_reply_to":"5a890539_f3b98816","updated":"2014-11-18 20:34:04.000000000","message":"This is actually coming in the next patch set. But thanks anyway for noticing ;)","commit_id":"41bb9fa2f2ee2c8ccf2ce0a6c62d666e4b4d9baa"},{"author":{"_account_id":8106,"name":"Haomeng,Wang","email":"wanghaomeng@gmail.com","username":"whaom"},"change_message_id":"f7b17d7106a0e2b68c7df0e526ae1164adb95ee7","unresolved":false,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from oslo.config import cfg"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from ironic.openstack.common import lockutils"},{"line_number":21,"context_line":"from ironic.openstack.common import policy"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"_ENFORCER \u003d None"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_320e6f35","line":20,"updated":"2014-11-20 03:24:19.000000000","message":"Should be \"from oslo.concurrency import lockutils\", make sense?","commit_id":"36e511b16348606d56799bffaadce95b45be1207"},{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"a64d0957121ceb477b1da2ec494f6f1eb92cf251","unresolved":false,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from oslo.config import cfg"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from ironic.openstack.common import lockutils"},{"line_number":21,"context_line":"from ironic.openstack.common import policy"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"_ENFORCER \u003d None"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_9f82c3fe","line":20,"in_reply_to":"5a890539_320e6f35","updated":"2014-11-20 10:27:00.000000000","message":"Done","commit_id":"36e511b16348606d56799bffaadce95b45be1207"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"7c561d579702d6ee8eb287e34e718e68dba9528b","unresolved":false,"context_lines":[{"line_number":24,"context_line":"CONF \u003d cfg.CONF"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"EM_SEMAPHORE \u003d \u0027policy_enforcer\u0027"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"@lockutils.synchronized(EM_SEMAPHORE, \u0027ironic-\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_342ad690","line":27,"updated":"2014-11-20 10:01:00.000000000","message":"If this constant is used only in one place, it may be inlined","commit_id":"36e511b16348606d56799bffaadce95b45be1207"},{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"a64d0957121ceb477b1da2ec494f6f1eb92cf251","unresolved":false,"context_lines":[{"line_number":24,"context_line":"CONF \u003d cfg.CONF"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"EM_SEMAPHORE \u003d \u0027policy_enforcer\u0027"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"@lockutils.synchronized(EM_SEMAPHORE, \u0027ironic-\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_bf85bf08","line":27,"in_reply_to":"5a890539_342ad690","updated":"2014-11-20 10:27:00.000000000","message":"Done","commit_id":"36e511b16348606d56799bffaadce95b45be1207"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"7c561d579702d6ee8eb287e34e718e68dba9528b","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"@lockutils.synchronized(EM_SEMAPHORE, \u0027ironic-\u0027)"},{"line_number":31,"context_line":"def _init_enforcer(policy_file\u003dNone, rules\u003dNone,"},{"line_number":32,"context_line":"                   default_rule\u003dNone, use_conf\u003dTrue):"},{"line_number":33,"context_line":"    \"\"\"Init an Enforcer class."},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"       :param policy_file: Custom policy file to use, if none is specified,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_5f269bbb","line":32,"updated":"2014-11-20 10:01:00.000000000","message":"It does not look it\u0027s used anywhere else, so it may make sense to inline it into get_enforcer()","commit_id":"36e511b16348606d56799bffaadce95b45be1207"},{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"a64d0957121ceb477b1da2ec494f6f1eb92cf251","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"@lockutils.synchronized(EM_SEMAPHORE, \u0027ironic-\u0027)"},{"line_number":31,"context_line":"def _init_enforcer(policy_file\u003dNone, rules\u003dNone,"},{"line_number":32,"context_line":"                   default_rule\u003dNone, use_conf\u003dTrue):"},{"line_number":33,"context_line":"    \"\"\"Init an Enforcer class."},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"       :param policy_file: Custom policy file to use, if none is specified,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_9f9f2303","line":32,"in_reply_to":"5a890539_5f269bbb","updated":"2014-11-20 10:27:00.000000000","message":"I\u0027ll inline this whole function to get_enforcer(). I don\u0027t think making the whole get_enforcer() synchronous.","commit_id":"36e511b16348606d56799bffaadce95b45be1207"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"9d1f3e5696b310b6e136535c085ba3d24707aec4","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"def get_enforcer(policy_file\u003dNone, rules\u003dNone,"},{"line_number":28,"context_line":"                 default_rule\u003dNone, use_conf\u003dTrue):"},{"line_number":29,"context_line":"    \"\"\"Provides access to the single instance of Policy enforcer"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"       :param policy_file: Custom policy file to use, if none is specified,"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a890539_d3a72c4f","line":28,"updated":"2014-11-26 17:44:28.000000000","message":"I find this misleading. The first time you call this, the parameters will be taken into consideration. All subsequent times, an enforcer will exist, and the parameters will be ignored.\n\nI probably shouldn\u0027t but I looked at how nova does it. They have an init(), and just access _ENFORCER. Their init() has a similar problem, but because it is called \u0027init\u0027, one might expect that it will only be initialized once.\n\nI quickly looked at the comments from previous revisions. I see that it has morphed from an init... to this. If you want get_enforcer(), my suggestion is to pull the init out (with parameters), and change get_enforcer so that it doesn\u0027t have any parameters.","commit_id":"b4de9faa3976140dc53928511d83004045e3b239"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"c89edc4e06883ad772ce740d03dabcca7fdb7026","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"def get_enforcer(policy_file\u003dNone, rules\u003dNone,"},{"line_number":28,"context_line":"                 default_rule\u003dNone, use_conf\u003dTrue):"},{"line_number":29,"context_line":"    \"\"\"Provides access to the single instance of Policy enforcer"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"       :param policy_file: Custom policy file to use, if none is specified,"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a890539_9f720c7a","line":28,"updated":"2014-12-05 00:57:45.000000000","message":"I share Ruby\u0027s concern about this method","commit_id":"b4de9faa3976140dc53928511d83004045e3b239"},{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"8e66804051efc2e37d0e027e0ef8fb47afd1d19d","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"def get_enforcer(policy_file\u003dNone, rules\u003dNone,"},{"line_number":28,"context_line":"                 default_rule\u003dNone, use_conf\u003dTrue):"},{"line_number":29,"context_line":"    \"\"\"Provides access to the single instance of Policy enforcer"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"       :param policy_file: Custom policy file to use, if none is specified,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_36a58a04","line":28,"in_reply_to":"5a890539_9f720c7a","updated":"2014-12-16 23:16:43.000000000","message":"Done","commit_id":"b4de9faa3976140dc53928511d83004045e3b239"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"9d1f3e5696b310b6e136535c085ba3d24707aec4","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"def enforce(rule, target, creds, do_raise\u003dFalse, exc\u003dNone, *args, **kwargs):"},{"line_number":62,"context_line":"    \"\"\"A shortcut for policy.Enforcer.enforce().\"\"\""},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    enforcer \u003d get_enforcer()"},{"line_number":65,"context_line":"    return enforcer.enforce(rule, target, creds, do_raise\u003ddo_raise,"},{"line_number":66,"context_line":"                            exc\u003dexc, *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a890539_815d4a7c","line":63,"updated":"2014-11-26 17:44:28.000000000","message":"Even though it is a shortcut, it\u0027d be nice to see a description of the params here although I suppose it makes sense not to copy/paste since it makes it harder to keep it in sync. Ok, don\u0027t put it ;)","commit_id":"b4de9faa3976140dc53928511d83004045e3b239"},{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"8e66804051efc2e37d0e027e0ef8fb47afd1d19d","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"def enforce(rule, target, creds, do_raise\u003dFalse, exc\u003dNone, *args, **kwargs):"},{"line_number":62,"context_line":"    \"\"\"A shortcut for policy.Enforcer.enforce().\"\"\""},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    enforcer \u003d get_enforcer()"},{"line_number":65,"context_line":"    return enforcer.enforce(rule, target, creds, do_raise\u003ddo_raise,"},{"line_number":66,"context_line":"                            exc\u003dexc, *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_b68fba74","line":63,"in_reply_to":"5a890539_815d4a7c","updated":"2014-12-16 23:16:43.000000000","message":"0_o\nAs far as I understood copying a description would be sufficient :)","commit_id":"b4de9faa3976140dc53928511d83004045e3b239"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"9d1f3e5696b310b6e136535c085ba3d24707aec4","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    enforcer \u003d get_enforcer()"},{"line_number":65,"context_line":"    return enforcer.enforce(rule, target, creds, do_raise\u003ddo_raise,"},{"line_number":66,"context_line":"                            exc\u003dexc, *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a890539_7c8645dd","line":66,"updated":"2014-11-26 17:44:28.000000000","message":"There\u0027s no way to reset the _ENFORCER or to set_rules(), whereas the original version had that. Are we OK with this?","commit_id":"b4de9faa3976140dc53928511d83004045e3b239"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"0f4ac39800e94c69857d1f3e6661c65c80a3a69f","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    enforcer \u003d get_enforcer()"},{"line_number":65,"context_line":"    return enforcer.enforce(rule, target, creds, do_raise\u003ddo_raise,"},{"line_number":66,"context_line":"                            exc\u003dexc, *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_6104997e","line":66,"in_reply_to":"3a961159_56cf76b0","updated":"2014-12-17 14:25:59.000000000","message":"adding an init() is one step towards resetting _ENFORCER. We could add a reset() later if there is a need for it (since I don\u0027t see that in revision 7 and it isn\u0027t necessary now).","commit_id":"b4de9faa3976140dc53928511d83004045e3b239"},{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"8e66804051efc2e37d0e027e0ef8fb47afd1d19d","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    enforcer \u003d get_enforcer()"},{"line_number":65,"context_line":"    return enforcer.enforce(rule, target, creds, do_raise\u003ddo_raise,"},{"line_number":66,"context_line":"                            exc\u003dexc, *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a961159_56cf76b0","line":66,"in_reply_to":"5a890539_7c8645dd","updated":"2014-12-16 23:16:43.000000000","message":"I will pull init() from get_enforcer() and that would be a way of resetting it.","commit_id":"b4de9faa3976140dc53928511d83004045e3b239"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"9bf87c2143eb28ae8acfa721d9ac2dc5de074cfb","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"\"\"\"Policy Engine For Ironic.\"\"\""},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from oslo.concurrency import lockutils"},{"line_number":19,"context_line":"from oslo.config import cfg"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from ironic.openstack.common import policy"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_d3f7e68a","line":18,"updated":"2014-12-17 11:32:06.000000000","message":"s/oslo.concurrency/oslo_concurrency/\n\nsee: https://review.openstack.org/#/c/139782/","commit_id":"0276d5a39710b4ff9d5e88b843cdaf221e96c48a"}],"ironic/tests/policy_fixture.py":[{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"aac54d6e240536eb9ef04077228b0e6c163908ab","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def set_rules(self, rules):"},{"line_number":41,"context_line":"        ironic_policy.set_rules(dict((k, common_policy.parse_rule(v))"},{"line_number":42,"context_line":"                                     for k, v in rules.items()))"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_53dc1c47","line":42,"updated":"2014-11-18 17:57:51.000000000","message":"set_rules doesn\u0027t exist in ironic.common.policy. Which makes me think this method isn\u0027t being called.","commit_id":"41bb9fa2f2ee2c8ccf2ce0a6c62d666e4b4d9baa"},{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"c50aaed7fccebf29625c78b103758ddc7de675db","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def set_rules(self, rules):"},{"line_number":41,"context_line":"        ironic_policy.set_rules(dict((k, common_policy.parse_rule(v))"},{"line_number":42,"context_line":"                                     for k, v in rules.items()))"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a890539_96af4d94","line":42,"in_reply_to":"5a890539_53dc1c47","updated":"2014-11-18 20:34:04.000000000","message":"Yes, I made a wrong rebase, will fix that in the next patch set. Thanks!","commit_id":"41bb9fa2f2ee2c8ccf2ce0a6c62d666e4b4d9baa"},{"author":{"_account_id":7882,"name":"Yuiko Takada Mori","email":"yuiko-mori@nec.com","username":"YuikoTakada"},"change_message_id":"68ad3ab3671ae739dddc8ef7ea25b0442cd7def3","unresolved":false,"context_lines":[{"line_number":17,"context_line":"import fixtures"},{"line_number":18,"context_line":"from oslo.config import cfg"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from ironic.common import policy as ironic_policy"},{"line_number":21,"context_line":"from ironic.openstack.common import policy as common_policy"},{"line_number":22,"context_line":"from ironic.tests import fake_policy"},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_48826753","line":20,"updated":"2014-11-20 06:39:12.000000000","message":"we can delete this because it is no longer used.","commit_id":"36e511b16348606d56799bffaadce95b45be1207"},{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"a64d0957121ceb477b1da2ec494f6f1eb92cf251","unresolved":false,"context_lines":[{"line_number":17,"context_line":"import fixtures"},{"line_number":18,"context_line":"from oslo.config import cfg"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from ironic.common import policy as ironic_policy"},{"line_number":21,"context_line":"from ironic.openstack.common import policy as common_policy"},{"line_number":22,"context_line":"from ironic.tests import fake_policy"},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"5a890539_df760bd8","line":20,"in_reply_to":"5a890539_48826753","updated":"2014-11-20 10:27:00.000000000","message":"Done","commit_id":"36e511b16348606d56799bffaadce95b45be1207"}],"ironic/tests/test_policy.py":[{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"fcc1fd503600eaf8ee220689ad9c4d2738e2731a","unresolved":false,"context_lines":[{"line_number":57,"context_line":"class PolicyTestCaseNegative(base.TestCase):"},{"line_number":58,"context_line":"    \"\"\"Tests whether the configuration of the policy engine is corect.\"\"\""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def enforce(self, rule, creds):"},{"line_number":61,"context_line":"        \"\"\"Just a shortcut to make further code more readable.\"\"\""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        return ironic_policy.get_enforcer().enforce(rule, creds, creds)"}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_0ea2ae98","line":60,"updated":"2014-10-07 09:04:18.000000000","message":"this method is duplicated with the one in PolicyTestCase, we can move it outside both classes.\n\nAlso, it\u0027s similar to what I suggested on the common/policy.py, it\u0027s a convenient wrapper I think we should have it there","commit_id":"5e5bd8530d777f66a53e85b2453e3ce5f85625e0"},{"author":{"_account_id":6623,"name":"Roman Prykhodchenko","email":"me@romcheg.me","username":"prykhodchenko"},"change_message_id":"bcabd8d0ab11f6973eba7f4b9963d06d7cdc1de1","unresolved":false,"context_lines":[{"line_number":57,"context_line":"class PolicyTestCaseNegative(base.TestCase):"},{"line_number":58,"context_line":"    \"\"\"Tests whether the configuration of the policy engine is corect.\"\"\""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def enforce(self, rule, creds):"},{"line_number":61,"context_line":"        \"\"\"Just a shortcut to make further code more readable.\"\"\""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        return ironic_policy.get_enforcer().enforce(rule, creds, creds)"}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_baeb9876","line":60,"in_reply_to":"baa201ad_0ea2ae98","updated":"2014-10-07 12:11:06.000000000","message":"I think with your suggestion about policy.enforce this wrapper won\u0027t be required anymore so I\u0027m going to remove it.","commit_id":"5e5bd8530d777f66a53e85b2453e3ce5f85625e0"}]}
