)]}'
{"nova/compute/api.py":[{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"b7c388b4f8f437e25b8c754f03e261fed38604be","unresolved":false,"context_lines":[{"line_number":1543,"context_line":"        self._cast_compute_message(\u0027inject_network_info\u0027, context,"},{"line_number":1544,"context_line":"                                   instance[\u0027uuid\u0027])"},{"line_number":1545,"context_line":""},{"line_number":1546,"context_line":"    def attach_volume(self, context, instance, volume_id, device):"},{"line_number":1547,"context_line":"        \"\"\"Attach an existing volume to an existing instance.\"\"\""},{"line_number":1548,"context_line":"        if not re.match(\"^/dev/x{0,1}[a-z]d[a-z]+$\", device):"},{"line_number":1549,"context_line":"            raise exception.ApiError(_(\"Invalid device specified: %s. \""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAD3%2F%2F%2FKU%3D","side":"PARENT","line":1546,"updated":"2012-01-11 02:17:57.000000000","message":"Wouldn\u0027t the policy enforcement need the volume object or ID?","commit_id":"4c5586a28fd7a085369c49f6039876ffdc86b526"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"1e1ebfadd0da6818f3f32ad8dabcc0c2b27de78e","unresolved":false,"context_lines":[{"line_number":1543,"context_line":"        self._cast_compute_message(\u0027inject_network_info\u0027, context,"},{"line_number":1544,"context_line":"                                   instance[\u0027uuid\u0027])"},{"line_number":1545,"context_line":""},{"line_number":1546,"context_line":"    def attach_volume(self, context, instance, volume_id, device):"},{"line_number":1547,"context_line":"        \"\"\"Attach an existing volume to an existing instance.\"\"\""},{"line_number":1548,"context_line":"        if not re.match(\"^/dev/x{0,1}[a-z]d[a-z]+$\", device):"},{"line_number":1549,"context_line":"            raise exception.ApiError(_(\"Invalid device specified: %s. \""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAD3%2F%2F%2B9Y%3D","side":"PARENT","line":1546,"in_reply_to":"AAAAD3%2F%2F%2FKU%3D","updated":"2012-01-11 17:28:35.000000000","message":"That is something we would check from the volume api. See that in a future patch.","commit_id":"4c5586a28fd7a085369c49f6039876ffdc86b526"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"b7c388b4f8f437e25b8c754f03e261fed38604be","unresolved":false,"context_lines":[{"line_number":561,"context_line":"            policy.enforce(context, \"compute:create:attach_network\", target)"},{"line_number":562,"context_line":""},{"line_number":563,"context_line":"        if block_device_mapping:"},{"line_number":564,"context_line":"            policy.enforce(context, \"compute:create:attach_volume\", target)"},{"line_number":565,"context_line":""},{"line_number":566,"context_line":"        # We can create the DB entry for the instance here if we\u0027re"},{"line_number":567,"context_line":"        # only going to create 1 instance and we\u0027re in a single"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAD3%2F%2F%2FKg%3D","line":564,"updated":"2012-01-11 02:17:57.000000000","message":"Wouldn\u0027t these calls need the requested_networks and block_device_mapping info?\n\nAnd should you use self.rule_prefix instead of hard coding \u0027compute:\u0027 so there\u0027s 1 place to change if needed in the future?  Other cases of this below.","commit_id":"64be698060a3ff89388221471bfd10ef90b09de3"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"1e1ebfadd0da6818f3f32ad8dabcc0c2b27de78e","unresolved":false,"context_lines":[{"line_number":561,"context_line":"            policy.enforce(context, \"compute:create:attach_network\", target)"},{"line_number":562,"context_line":""},{"line_number":563,"context_line":"        if block_device_mapping:"},{"line_number":564,"context_line":"            policy.enforce(context, \"compute:create:attach_volume\", target)"},{"line_number":565,"context_line":""},{"line_number":566,"context_line":"        # We can create the DB entry for the instance here if we\u0027re"},{"line_number":567,"context_line":"        # only going to create 1 instance and we\u0027re in a single"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAD3%2F%2F%2B%2B8%3D","line":564,"in_reply_to":"AAAAD3%2F%2F%2FKg%3D","updated":"2012-01-11 17:28:35.000000000","message":"At this point I\u0027m just trying to get as much covered as possible. So right now the checks are really centered around roles and project ids. We will spend a lot more time fleshing out each individual call and what data needs to be made available at a later time.\n\nAs for the rule_prefix call -- yes. I refactored it a bit to I dont have to duplicate logic in building the prefixed action names.","commit_id":"64be698060a3ff89388221471bfd10ef90b09de3"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"b7c388b4f8f437e25b8c754f03e261fed38604be","unresolved":false,"context_lines":[{"line_number":1612,"context_line":"        if not instance:"},{"line_number":1613,"context_line":"            raise exception.ApiError(_(\"Volume isn\u0027t attached to anything!\"))"},{"line_number":1614,"context_line":""},{"line_number":1615,"context_line":"        policy.enforce(context, \u0027compute:detach_volume\u0027, instance)"},{"line_number":1616,"context_line":""},{"line_number":1617,"context_line":"        self.volume_api.check_detach(context, volume_id\u003dvolume_id)"},{"line_number":1618,"context_line":"        host \u003d instance[\u0027host\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAD3%2F%2F%2FKY%3D","line":1615,"updated":"2012-01-11 02:17:57.000000000","message":"Same as above.","commit_id":"64be698060a3ff89388221471bfd10ef90b09de3"}],"nova/network/api.py":[{"author":{"_account_id":191,"name":"Trey Morris","email":"trey.morris@rackspace.com","username":"tr3buchet"},"change_message_id":"8dbcc5cfdbd32f99f6152e87080053b1f4fd2e76","unresolved":false,"context_lines":[{"line_number":39,"context_line":"            Does *not* work for quantum defined nets."},{"line_number":40,"context_line":"            TODO(JMC)"},{"line_number":41,"context_line":"        \"\"\""},{"line_number":42,"context_line":"        rv \u003d self.db.network_get_by_uuid(context, network_id)"},{"line_number":43,"context_line":"        return dict(rv.iteritems())"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def get_floating_ip(self, context, id):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAD3%2F%2F%2FO8%3D","line":42,"updated":"2012-01-10 22:58:48.000000000","message":"do not want\n\nthis call should be in the network manager, if at all","commit_id":"bd938f5e44423bb998112365fd6d57afec479dc7"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"386f12fb020b1a8235ce981625e5fa72261be636","unresolved":false,"context_lines":[{"line_number":39,"context_line":"            Does *not* work for quantum defined nets."},{"line_number":40,"context_line":"            TODO(JMC)"},{"line_number":41,"context_line":"        \"\"\""},{"line_number":42,"context_line":"        rv \u003d self.db.network_get_by_uuid(context, network_id)"},{"line_number":43,"context_line":"        return dict(rv.iteritems())"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def get_floating_ip(self, context, id):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAD3%2F%2F%2FOk%3D","line":42,"in_reply_to":"AAAAD3%2F%2F%2FO8%3D","updated":"2012-01-10 23:11:42.000000000","message":"Agree with Trey on this one. Let\u0027s find a way of getting rid of this from the network API class","commit_id":"bd938f5e44423bb998112365fd6d57afec479dc7"},{"author":{"_account_id":67,"name":"Vish Ishaya","email":"vishvananda@gmail.com","username":"vishvananda"},"change_message_id":"9d7f7778c9bf0ec6edf5e3df89a1e8256fd9d71b","unresolved":false,"context_lines":[{"line_number":39,"context_line":"            Does *not* work for quantum defined nets."},{"line_number":40,"context_line":"            TODO(JMC)"},{"line_number":41,"context_line":"        \"\"\""},{"line_number":42,"context_line":"        rv \u003d self.db.network_get_by_uuid(context, network_id)"},{"line_number":43,"context_line":"        return dict(rv.iteritems())"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def get_floating_ip(self, context, id):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAD3%2F%2F%2FOc%3D","line":42,"in_reply_to":"AAAAD3%2F%2F%2FO8%3D","updated":"2012-01-10 23:32:02.000000000","message":"Hmm that was added for an older version, don\u0027t think we need it.","commit_id":"bd938f5e44423bb998112365fd6d57afec479dc7"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"be2e0b187e20c853f8c75cc11f40e198aab241d0","unresolved":false,"context_lines":[{"line_number":39,"context_line":"            Does *not* work for quantum defined nets."},{"line_number":40,"context_line":"            TODO(JMC)"},{"line_number":41,"context_line":"        \"\"\""},{"line_number":42,"context_line":"        rv \u003d self.db.network_get_by_uuid(context, network_id)"},{"line_number":43,"context_line":"        return dict(rv.iteritems())"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def get_floating_ip(self, context, id):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAD3%2F%2F%2FOA%3D","line":42,"in_reply_to":"AAAAD3%2F%2F%2FOc%3D","updated":"2012-01-10 23:42:29.000000000","message":"Sorry about that. I based my work of off another patch that made this change. Removed!","commit_id":"bd938f5e44423bb998112365fd6d57afec479dc7"}],"nova/policy.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"386f12fb020b1a8235ce981625e5fa72261be636","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        raise exception.PolicyNotAuthorized(action\u003daction)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"def wrap_enforce(func):"},{"line_number":84,"context_line":"    @functools.wraps(func)"},{"line_number":85,"context_line":"    def wrapped(self, context, target, *args, **kwargs):"},{"line_number":86,"context_line":"        action \u003d \u0027%s:%s\u0027 % (self.rule_prefix, func.__name__)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAD3%2F%2F%2FOg%3D","line":83,"updated":"2012-01-10 23:11:42.000000000","message":"I would name this enforce and not wrap_enforce. None of the other decorators have the wrap_ prefix in their name, AFAICT.\n\nAlso, need a docstring.","commit_id":"bd938f5e44423bb998112365fd6d57afec479dc7"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"be2e0b187e20c853f8c75cc11f40e198aab241d0","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        raise exception.PolicyNotAuthorized(action\u003daction)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"def wrap_enforce(func):"},{"line_number":84,"context_line":"    @functools.wraps(func)"},{"line_number":85,"context_line":"    def wrapped(self, context, target, *args, **kwargs):"},{"line_number":86,"context_line":"        action \u003d \u0027%s:%s\u0027 % (self.rule_prefix, func.__name__)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAD3%2F%2F%2FN8%3D","line":83,"in_reply_to":"AAAAD3%2F%2F%2FOg%3D","updated":"2012-01-10 23:42:29.000000000","message":"My thinking was that it is wrapping methods with a call to enforce, which is defined above. I\u0027m not against changing the name, I just can\u0027t call it \u0027enforce\u0027.","commit_id":"bd938f5e44423bb998112365fd6d57afec479dc7"},{"author":{"_account_id":1030,"name":"Chris Behrens","email":"cbehrens@codestud.com","username":"cbehrens"},"change_message_id":"b7c388b4f8f437e25b8c754f03e261fed38604be","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from nova import exception"},{"line_number":21,"context_line":"from nova import flags"},{"line_number":22,"context_line":"from nova import utils"},{"line_number":23,"context_line":"from nova.common import policy"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"FLAGS \u003d flags.FLAGS"},{"line_number":26,"context_line":"flags.DEFINE_string(\u0027policy_file\u0027, \u0027policy.json\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAD3%2F%2F%2FKs%3D","side":"PARENT","line":23,"updated":"2012-01-11 02:17:57.000000000","message":"Might as well reorder this and yell at Vish.","commit_id":"4c5586a28fd7a085369c49f6039876ffdc86b526"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"1e1ebfadd0da6818f3f32ad8dabcc0c2b27de78e","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from nova import exception"},{"line_number":21,"context_line":"from nova import flags"},{"line_number":22,"context_line":"from nova import utils"},{"line_number":23,"context_line":"from nova.common import policy"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"FLAGS \u003d flags.FLAGS"},{"line_number":26,"context_line":"flags.DEFINE_string(\u0027policy_file\u0027, \u0027policy.json\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAD3%2F%2F%2B9U%3D","side":"PARENT","line":23,"in_reply_to":"AAAAD3%2F%2F%2FKs%3D","updated":"2012-01-11 17:28:35.000000000","message":"Done","commit_id":"4c5586a28fd7a085369c49f6039876ffdc86b526"},{"author":{"_account_id":34,"name":"Todd Willey","email":"todd@ansolabs.com","username":"xtoddx"},"change_message_id":"e4ace8619622c85eaeb453969b16e82ac4b348d5","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        raise exception.PolicyNotAuthorized(action\u003daction)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"def wrap_enforce(func):"},{"line_number":84,"context_line":"    @functools.wraps(func)"},{"line_number":85,"context_line":"    def wrapped(self, context, target, *args, **kwargs):"},{"line_number":86,"context_line":"        action \u003d \u0027%s:%s\u0027 % (self.rule_prefix, func.__name__)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAD3%2F%2F%2FNI%3D","line":83,"updated":"2012-01-10 23:53:26.000000000","message":"My comment here somehow got lost, but this doesn\u0027t actually need docstring since it uses functools.wraps()","commit_id":"64be698060a3ff89388221471bfd10ef90b09de3"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"1e1ebfadd0da6818f3f32ad8dabcc0c2b27de78e","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        raise exception.PolicyNotAuthorized(action\u003daction)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"def wrap_enforce(func):"},{"line_number":84,"context_line":"    @functools.wraps(func)"},{"line_number":85,"context_line":"    def wrapped(self, context, target, *args, **kwargs):"},{"line_number":86,"context_line":"        action \u003d \u0027%s:%s\u0027 % (self.rule_prefix, func.__name__)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAD3%2F%2F%2B84%3D","line":83,"in_reply_to":"AAAAD3%2F%2F%2FL0%3D","updated":"2012-01-11 17:28:35.000000000","message":"I went ahead and added a docstring. Can\u0027t hurt.","commit_id":"64be698060a3ff89388221471bfd10ef90b09de3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4f4d4ddd1c8b264a027eee523b7009736e4c4b07","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        raise exception.PolicyNotAuthorized(action\u003daction)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"def wrap_enforce(func):"},{"line_number":84,"context_line":"    @functools.wraps(func)"},{"line_number":85,"context_line":"    def wrapped(self, context, target, *args, **kwargs):"},{"line_number":86,"context_line":"        action \u003d \u0027%s:%s\u0027 % (self.rule_prefix, func.__name__)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAD3%2F%2F%2FL0%3D","line":83,"in_reply_to":"AAAAD3%2F%2F%2FNI%3D","updated":"2012-01-11 01:12:48.000000000","message":"The decorator definitely needs a docstring to say what the decorator does...","commit_id":"64be698060a3ff89388221471bfd10ef90b09de3"}]}
