)]}'
{"quantum/api/v2/resource.py":[{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"1c38f1d215ea20e9ad836f73e3ea56ed70594ce4","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        try:"},{"line_number":77,"context_line":"            if request.body:"},{"line_number":78,"context_line":"                args[\u0027body\u0027] \u003d deserializer.deserialize(request.body)[\u0027body\u0027]"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"            method \u003d getattr(controller, action)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"            result \u003d method(request\u003drequest, **args)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2FspU%3D","side":"PARENT","line":79,"updated":"2013-05-25 19:43:15.000000000","message":"whoops","commit_id":"59d6ad203575055f71846dd2811e5ca5110971ca"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":76,"context_line":"        try:"},{"line_number":77,"context_line":"            if request.body:"},{"line_number":78,"context_line":"                args[\u0027body\u0027] \u003d deserializer.deserialize(request.body)[\u0027body\u0027]"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"            method \u003d getattr(controller, action)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"            result \u003d method(request\u003drequest, **args)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2FsnQ%3D","side":"PARENT","line":79,"in_reply_to":"AAAAPH%2F%2FspU%3D","updated":"2013-05-25 22:03:27.000000000","message":"sorry...","commit_id":"59d6ad203575055f71846dd2811e5ca5110971ca"}],"quantum/policy.py":[{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"unresolved":false,"context_lines":[{"line_number":177,"context_line":"    return match_rule, target, credentials"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"def check(context, action, target, plugin\u003dNone):"},{"line_number":181,"context_line":"    \"\"\"Verifies that the action is valid on the target in this context."},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    :param context: quantum context"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2Fq7Q%3D","side":"PARENT","line":180,"updated":"2013-05-28 02:25:24.000000000","message":"how about making the check() interface consisent with enforce()?","commit_id":"59d6ad203575055f71846dd2811e5ca5110971ca"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"386e28afda3fb3bcff1f26f34c60108d40c3213c","unresolved":false,"context_lines":[{"line_number":210,"context_line":"    return policy.check(*(_prepare_check(context, action, target)))"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"def enforce(context, action, target, plugin\u003dNone):"},{"line_number":214,"context_line":"    \"\"\"Verifies that the action is valid on the target in this context."},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    :param context: quantum context"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2Fr8A%3D","side":"PARENT","line":213,"updated":"2013-05-27 05:08:57.000000000","message":"Looks like a compatibility problem. Maybe some external extension/plugin use policy directly. So we can\u0027t remove the parameter \u0027plugin\u0027. We can mark it as depreciate.","commit_id":"59d6ad203575055f71846dd2811e5ca5110971ca"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":210,"context_line":"    return policy.check(*(_prepare_check(context, action, target)))"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"def enforce(context, action, target, plugin\u003dNone):"},{"line_number":214,"context_line":"    \"\"\"Verifies that the action is valid on the target in this context."},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    :param context: quantum context"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2Fobw%3D","side":"PARENT","line":213,"in_reply_to":"AAAAPH%2F%2Fq6k%3D","updated":"2013-05-28 22:05:35.000000000","message":"This is true for a user, not for a developer.\nThis would be true if we were providing this as a library.\nA library makes a guarantee on the interface.\n\nHowever, I feel we could keep arguing for ages about this, and this would be an argument which brings no benefit.\nI will therefore do as you suggest.\nHopefully pep8 won\u0027t complain about the unused parameter.","commit_id":"59d6ad203575055f71846dd2811e5ca5110971ca"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":210,"context_line":"    return policy.check(*(_prepare_check(context, action, target)))"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"def enforce(context, action, target, plugin\u003dNone):"},{"line_number":214,"context_line":"    \"\"\"Verifies that the action is valid on the target in this context."},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    :param context: quantum context"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2Frac%3D","side":"PARENT","line":213,"in_reply_to":"AAAAPH%2F%2Fr8A%3D","updated":"2013-05-27 14:46:57.000000000","message":"The plugin parameter was added because of the build_target that we are removing.\n\nEven if I leave this parameter, it won\u0027t be passed anymore to build_target, simply because build_target doesn\u0027t use it.\n\nIf there are external plugins of which we do not know about invoking this function and passing the plugin instance to it, they will fail.\nAnd I reckon it\u0027s better to have them fail rather than having them behave in a way which is not the one expected from the caller.\n\nAs far as backward compatibility is concerned, there is a limit to what we would like to enforce.\nAPI, configuration files, plugin interface they should all be backward compatible. If we start to enforce this for each function which could be called by another module we\u0027d probably go a bit too far.","commit_id":"59d6ad203575055f71846dd2811e5ca5110971ca"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"386e28afda3fb3bcff1f26f34c60108d40c3213c","unresolved":false,"context_lines":[{"line_number":210,"context_line":"    return policy.check(*(_prepare_check(context, action, target)))"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"def enforce(context, action, target, plugin\u003dNone):"},{"line_number":214,"context_line":"    \"\"\"Verifies that the action is valid on the target in this context."},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    :param context: quantum context"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2Fq6k%3D","side":"PARENT","line":213,"in_reply_to":"AAAAPH%2F%2Frac%3D","updated":"2013-05-28 03:28:55.000000000","message":"I think bw compatibility means developer upgrade quantum code, then his plugin/extension can run directly without any fail.","commit_id":"59d6ad203575055f71846dd2811e5ca5110971ca"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"unresolved":false,"context_lines":[{"line_number":210,"context_line":"    return policy.check(*(_prepare_check(context, action, target)))"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"def enforce(context, action, target, plugin\u003dNone):"},{"line_number":214,"context_line":"    \"\"\"Verifies that the action is valid on the target in this context."},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    :param context: quantum context"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2Fq70%3D","side":"PARENT","line":213,"in_reply_to":"AAAAPH%2F%2Frac%3D","updated":"2013-05-28 02:25:24.000000000","message":"If our principle is to keep compatible, we had better to follow it.","commit_id":"59d6ad203575055f71846dd2811e5ca5110971ca"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":133,"context_line":"            self.target_field \u003d re.findall(\u0027^\\%\\((.*)\\)s$\u0027,"},{"line_number":134,"context_line":"                                           match)[0]"},{"line_number":135,"context_line":"        except IndexError:"},{"line_number":136,"context_line":"            err_reason \u003d (_(\"Unable to identify a target field from:%s. The \""},{"line_number":137,"context_line":"                            \"match should be in the form %(\u003cfield_name\u003e)s\"),"},{"line_number":138,"context_line":"                          match)"},{"line_number":139,"context_line":"            LOG.exception(err_reason)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2FshE%3D","line":136,"updated":"2013-05-26 05:21:50.000000000","message":"Not sure if the err_reason would be displayed correctly.\nThe %s could be problematic.\n\nShould \u003cfield_name\u003e be field_name?","commit_id":"e8fee415a669dc643ceb09c184789b1ed29dd617"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":133,"context_line":"            self.target_field \u003d re.findall(\u0027^\\%\\((.*)\\)s$\u0027,"},{"line_number":134,"context_line":"                                           match)[0]"},{"line_number":135,"context_line":"        except IndexError:"},{"line_number":136,"context_line":"            err_reason \u003d (_(\"Unable to identify a target field from:%s. The \""},{"line_number":137,"context_line":"                            \"match should be in the form %(\u003cfield_name\u003e)s\"),"},{"line_number":138,"context_line":"                          match)"},{"line_number":139,"context_line":"            LOG.exception(err_reason)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2FsYM%3D","line":136,"in_reply_to":"AAAAPH%2F%2FshE%3D","updated":"2013-05-26 11:11:24.000000000","message":"ah you\u0027re right\nI wanted %(\u003cfield_name\u003e)s to be printed just like you see it, but it would probably be treated as a format specifiier.\n\nThe first %s will be displayed correctly once the other thing I fixed.","commit_id":"e8fee415a669dc643ceb09c184789b1ed29dd617"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"386e28afda3fb3bcff1f26f34c60108d40c3213c","unresolved":false,"context_lines":[{"line_number":147,"context_line":"            # policy needs a plugin check"},{"line_number":148,"context_line":"            # target field is in the form resource_field"},{"line_number":149,"context_line":"            try:"},{"line_number":150,"context_line":"                parent_res, parent_field \u003d self.target_field.split(\u0027_\u0027, 1)"},{"line_number":151,"context_line":"            except ValueError:"},{"line_number":152,"context_line":"                err_reason \u003d (_(\"Unable to find resource name in %s\") %"},{"line_number":153,"context_line":"                              self.target_field)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2Fq6Q%3D","line":150,"updated":"2013-05-28 03:28:55.000000000","message":"This won\u0027t work with resource name include \u0027_\u0027, like \u0027security_group\u0027...etc. But we didn\u0027t have such rule use those resource. So I\u0027m not sure. It\u0027s ok for now.","commit_id":"e8fee415a669dc643ceb09c184789b1ed29dd617"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":147,"context_line":"            # policy needs a plugin check"},{"line_number":148,"context_line":"            # target field is in the form resource_field"},{"line_number":149,"context_line":"            try:"},{"line_number":150,"context_line":"                parent_res, parent_field \u003d self.target_field.split(\u0027_\u0027, 1)"},{"line_number":151,"context_line":"            except ValueError:"},{"line_number":152,"context_line":"                err_reason \u003d (_(\"Unable to find resource name in %s\") %"},{"line_number":153,"context_line":"                              self.target_field)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2FoXE%3D","line":150,"in_reply_to":"AAAAPH%2F%2Focw%3D","updated":"2013-05-28 22:29:10.000000000","message":"Well it\u0027s not that easy unfortunately","commit_id":"e8fee415a669dc643ceb09c184789b1ed29dd617"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":147,"context_line":"            # policy needs a plugin check"},{"line_number":148,"context_line":"            # target field is in the form resource_field"},{"line_number":149,"context_line":"            try:"},{"line_number":150,"context_line":"                parent_res, parent_field \u003d self.target_field.split(\u0027_\u0027, 1)"},{"line_number":151,"context_line":"            except ValueError:"},{"line_number":152,"context_line":"                err_reason \u003d (_(\"Unable to find resource name in %s\") %"},{"line_number":153,"context_line":"                              self.target_field)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2Focw%3D","line":150,"in_reply_to":"AAAAPH%2F%2Fq6Q%3D","updated":"2013-05-28 22:05:35.000000000","message":"As usual you are right. We stil want users to create policies which make sense, like \"resource_attribute\", but this will fail for resources with an underscore.\n\nThen we fix this just by using rsplit instead of split.","commit_id":"e8fee415a669dc643ceb09c184789b1ed29dd617"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"unresolved":false,"context_lines":[{"line_number":165,"context_line":"                raise exceptions.PolicyCheckError("},{"line_number":166,"context_line":"                    policy\u003d\"%s:%s\" % (self.kind, self.match),"},{"line_number":167,"context_line":"                    reason\u003derr_reason)"},{"line_number":168,"context_line":"            f \u003d getattr(manager.QuantumManager.get_instance().plugin,"},{"line_number":169,"context_line":"                        \u0027get_%s\u0027 % parent_res)"},{"line_number":170,"context_line":"            # f *must* exist, if not found it is better to let quantum"},{"line_number":171,"context_line":"            # explode. Check will be performed with admin context"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2Fq78%3D","line":168,"updated":"2013-05-28 02:25:24.000000000","message":"this will limit the policy to core plugin?","commit_id":"e8fee415a669dc643ceb09c184789b1ed29dd617"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":165,"context_line":"                raise exceptions.PolicyCheckError("},{"line_number":166,"context_line":"                    policy\u003d\"%s:%s\" % (self.kind, self.match),"},{"line_number":167,"context_line":"                    reason\u003derr_reason)"},{"line_number":168,"context_line":"            f \u003d getattr(manager.QuantumManager.get_instance().plugin,"},{"line_number":169,"context_line":"                        \u0027get_%s\u0027 % parent_res)"},{"line_number":170,"context_line":"            # f *must* exist, if not found it is better to let quantum"},{"line_number":171,"context_line":"            # explode. Check will be performed with admin context"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2FobY%3D","line":168,"in_reply_to":"AAAAPH%2F%2Fq78%3D","updated":"2013-05-28 22:05:35.000000000","message":"At the moment we assume that the parent resource is served by the same plugin as the dependent one.\nWe do not have the infrastructure to know which plugin handles a given resource.\nI am aware we have a way to find that. As you can see however, the bug that we\u0027re trying to fix here is about performance at scale. If we add something that iterates over extensions to find which extension provides a resource and then from it find the plugin I feel like we will be missing the point of this bug report.\n\nSince so far we do not happen to have resources in a plugin which are owned by another plugin, I will limit to add a note in the code, if that\u0027s ok for you.","commit_id":"e8fee415a669dc643ceb09c184789b1ed29dd617"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"386e28afda3fb3bcff1f26f34c60108d40c3213c","unresolved":false,"context_lines":[{"line_number":276,"context_line":"    if target is None:"},{"line_number":277,"context_line":"        target \u003d {}"},{"line_number":278,"context_line":"    match_rule \u003d _build_match_rule(action, target)"},{"line_number":279,"context_line":"    credentials \u003d context.to_dict()"},{"line_number":280,"context_line":"    return policy.check(match_rule, target, credentials,"},{"line_number":281,"context_line":"                        exceptions.PolicyNotAuthorized, action\u003daction)"},{"line_number":282,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2Fr7s%3D","line":279,"updated":"2013-05-27 05:08:57.000000000","message":"This isn\u0027t your patch problem. How about use \u0027_prepare_check\u0027 directly at here?","commit_id":"e8fee415a669dc643ceb09c184789b1ed29dd617"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":276,"context_line":"    if target is None:"},{"line_number":277,"context_line":"        target \u003d {}"},{"line_number":278,"context_line":"    match_rule \u003d _build_match_rule(action, target)"},{"line_number":279,"context_line":"    credentials \u003d context.to_dict()"},{"line_number":280,"context_line":"    return policy.check(match_rule, target, credentials,"},{"line_number":281,"context_line":"                        exceptions.PolicyNotAuthorized, action\u003daction)"},{"line_number":282,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2FraM%3D","line":279,"in_reply_to":"AAAAPH%2F%2Fr7s%3D","updated":"2013-05-27 14:46:57.000000000","message":"Done","commit_id":"e8fee415a669dc643ceb09c184789b1ed29dd617"}]}
