)]}'
{"bin/nova-manage":[{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"change_message_id":"6f99c22186d555b15cc2d5d5c974514ca6ab81c7","unresolved":false,"context_lines":[{"line_number":498,"context_line":"        for key, value in project_quota.iteritems():"},{"line_number":499,"context_line":"            if value[\u0027limit\u0027] \u003c 0 or value[\u0027limit\u0027] is None:"},{"line_number":500,"context_line":"                value[\u0027limit\u0027] \u003d \u0027unlimited\u0027"},{"line_number":501,"context_line":"            print \u0027%s: %s\u0027 % (key, value[\u0027limit\u0027])"},{"line_number":502,"context_line":""},{"line_number":503,"context_line":"    @args(\u0027--project\u0027, dest\u003d\"project_id\", metavar\u003d\u0027\u003cProject name\u003e\u0027,"},{"line_number":504,"context_line":"            help\u003d\u0027Project name\u0027)"}],"source_content_type":"application/octet-stream","patch_set":9,"id":"AAAAHX%2F%2F6Ac%3D","line":501,"updated":"2012-05-19 00:44:26.000000000","message":"This spec should be documented","commit_id":"3db0879a93b036b4eb5c04f178f6133c9ddbd939"},{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"3d31253232ba322d9aee52ef8a254446beb5875e","unresolved":false,"context_lines":[{"line_number":496,"context_line":"                db.quota_create(ctxt, project_id, key, value)"},{"line_number":497,"context_line":"        project_quota \u003d QUOTAS.get_project_quotas(ctxt, project_id)"},{"line_number":498,"context_line":"        for key, value in project_quota.iteritems():"},{"line_number":499,"context_line":"            if value[\u0027limit\u0027] \u003c 0 or value[\u0027limit\u0027] is None:"},{"line_number":500,"context_line":"                value[\u0027limit\u0027] \u003d \u0027unlimited\u0027"},{"line_number":501,"context_line":"            print \u0027%s: %s\u0027 % (key, value[\u0027limit\u0027])"},{"line_number":502,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":10,"id":"AAAAHX%2F%2F5dM%3D","line":499,"updated":"2012-05-21 22:22:38.000000000","message":"This conditional will short-circuit in the None case.  None evalutes to True for \u003c 0.\n\n\u003e\u003e\u003e if None \u003c 0:\n...   print \"foo\"\n... \nfoo\n\nIt\u0027s weird, I know.","commit_id":"aabe17cef4c07e0daffae4e0caa70102e2bfea0b"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"049e2f00a503cd8ef6f08935bb1463725c6c7265","unresolved":false,"context_lines":[{"line_number":496,"context_line":"                db.quota_create(ctxt, project_id, key, value)"},{"line_number":497,"context_line":"        project_quota \u003d QUOTAS.get_project_quotas(ctxt, project_id)"},{"line_number":498,"context_line":"        for key, value in project_quota.iteritems():"},{"line_number":499,"context_line":"            if value[\u0027limit\u0027] \u003c 0 or value[\u0027limit\u0027] is None:"},{"line_number":500,"context_line":"                value[\u0027limit\u0027] \u003d \u0027unlimited\u0027"},{"line_number":501,"context_line":"            print \u0027%s: %s\u0027 % (key, value[\u0027limit\u0027])"},{"line_number":502,"context_line":""}],"source_content_type":"application/octet-stream","patch_set":10,"id":"AAAAHX%2F%2F5X4%3D","line":499,"in_reply_to":"AAAAHX%2F%2F5dM%3D","updated":"2012-05-21 22:40:49.000000000","message":"Heh.  That is weird.","commit_id":"aabe17cef4c07e0daffae4e0caa70102e2bfea0b"}],"nova/api/ec2/cloud.py":[{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"3d31253232ba322d9aee52ef8a254446beb5875e","unresolved":false,"context_lines":[{"line_number":782,"context_line":"            raise exception.EC2APIError(msg % group_name)"},{"line_number":783,"context_line":""},{"line_number":784,"context_line":"        try:"},{"line_number":785,"context_line":"            reservations \u003d QUOTAS.reserve(context, security_groups\u003d1)"},{"line_number":786,"context_line":"        except exception.OverQuota:"},{"line_number":787,"context_line":"            msg \u003d _(\"Quota exceeded, too many security groups.\")"},{"line_number":788,"context_line":"            raise exception.EC2APIError(msg)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAHX%2F%2F5cc%3D","line":785,"updated":"2012-05-21 22:22:38.000000000","message":"I like the reservation design.  Should there be a default expiration policy, though?\n\n86,400 seconds seems like a pretty long time to reserve a resource by default.","commit_id":"aabe17cef4c07e0daffae4e0caa70102e2bfea0b"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"049e2f00a503cd8ef6f08935bb1463725c6c7265","unresolved":false,"context_lines":[{"line_number":782,"context_line":"            raise exception.EC2APIError(msg % group_name)"},{"line_number":783,"context_line":""},{"line_number":784,"context_line":"        try:"},{"line_number":785,"context_line":"            reservations \u003d QUOTAS.reserve(context, security_groups\u003d1)"},{"line_number":786,"context_line":"        except exception.OverQuota:"},{"line_number":787,"context_line":"            msg \u003d _(\"Quota exceeded, too many security groups.\")"},{"line_number":788,"context_line":"            raise exception.EC2APIError(msg)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAHX%2F%2F5Xw%3D","line":785,"in_reply_to":"AAAAHX%2F%2F5cc%3D","updated":"2012-05-21 22:40:49.000000000","message":"The expiration thing is a self-repair mechanism; \"If this breaks, make sure it eventually gets fixed.\"  The default of 86400 (1 day, by the way) is a good compromise between dealing with long-running tasks and making sure brokenness fixes itself.  It is tunable, however…","commit_id":"aabe17cef4c07e0daffae4e0caa70102e2bfea0b"}],"nova/api/openstack/compute/contrib/quota_classes.py":[{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"3d31253232ba322d9aee52ef8a254446beb5875e","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from nova import quota"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"QUOTAS \u003d quota.QUOTAS"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"authorize \u003d extensions.extension_authorizer(\u0027compute\u0027, \u0027quota_classes\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAHX%2F%2F5aM%3D","line":26,"updated":"2012-05-21 22:22:38.000000000","message":"Perhaps an explanation of quota classes would be good somewhere in the codebase?  I only found a reference to what they are on wiki.openstack.org.  Even an example would be nice.","commit_id":"aabe17cef4c07e0daffae4e0caa70102e2bfea0b"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"049e2f00a503cd8ef6f08935bb1463725c6c7265","unresolved":false,"context_lines":[{"line_number":23,"context_line":"from nova import quota"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"QUOTAS \u003d quota.QUOTAS"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"authorize \u003d extensions.extension_authorizer(\u0027compute\u0027, \u0027quota_classes\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAHX%2F%2F5Xs%3D","line":26,"in_reply_to":"AAAAHX%2F%2F5aM%3D","updated":"2012-05-21 22:40:49.000000000","message":"Perhaps; but that\u0027s outside the scope of this patch.  I added quota classes long before I started working on this…","commit_id":"aabe17cef4c07e0daffae4e0caa70102e2bfea0b"}],"nova/api/openstack/compute/contrib/quotas.py":[{"author":{"_account_id":688,"name":"Sandy Walsh","email":"sandy.walsh@rackspace.com","username":"sandy-walsh"},"change_message_id":"4b16b0e88d29dc4faa7a4fc1e7191190fb184e85","unresolved":false,"context_lines":[{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        if usages:"},{"line_number":69,"context_line":"            return values"},{"line_number":70,"context_line":"        else:"},{"line_number":71,"context_line":"            return dict((k, v[\u0027limit\u0027]) for k, v in values.items())"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    @wsgi.serializers(xml\u003dQuotaTemplate)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAHX%2F%2F7Ao%3D","line":70,"updated":"2012-05-16 17:47:42.000000000","message":"else: needed?","commit_id":"ed60a1497c4490b85273cec18e00cc2240f724cf"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"4142ce2f01f8fb5aa5dd1828392be4a6a0a24fd9","unresolved":false,"context_lines":[{"line_number":67,"context_line":""},{"line_number":68,"context_line":"        if usages:"},{"line_number":69,"context_line":"            return values"},{"line_number":70,"context_line":"        else:"},{"line_number":71,"context_line":"            return dict((k, v[\u0027limit\u0027]) for k, v in values.items())"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    @wsgi.serializers(xml\u003dQuotaTemplate)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAHX%2F%2F62g%3D","line":70,"in_reply_to":"AAAAHX%2F%2F7Ao%3D","updated":"2012-05-16 21:36:06.000000000","message":"Yes; two different formats.","commit_id":"ed60a1497c4490b85273cec18e00cc2240f724cf"}],"nova/api/openstack/compute/limits.py":[{"author":{"_account_id":688,"name":"Sandy Walsh","email":"sandy.walsh@rackspace.com","username":"sandy-walsh"},"change_message_id":"4b16b0e88d29dc4faa7a4fc1e7191190fb184e85","unresolved":false,"context_lines":[{"line_number":87,"context_line":"        context \u003d req.environ[\u0027nova.context\u0027]"},{"line_number":88,"context_line":"        quotas \u003d QUOTAS.get_project_quotas(context, context.project_id,"},{"line_number":89,"context_line":"                                           usages\u003dFalse)"},{"line_number":90,"context_line":"        abs_limits \u003d dict((k, v[\u0027limit\u0027]) for k, v in quotas.items())"},{"line_number":91,"context_line":"        rate_limits \u003d req.environ.get(\"nova.limits\", [])"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        builder \u003d self._get_view_builder(req)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAHX%2F%2F7BY%3D","line":90,"updated":"2012-05-16 17:47:42.000000000","message":"what if v[\u0027limit\u0027] doesn\u0027t exist?","commit_id":"ed60a1497c4490b85273cec18e00cc2240f724cf"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"4142ce2f01f8fb5aa5dd1828392be4a6a0a24fd9","unresolved":false,"context_lines":[{"line_number":87,"context_line":"        context \u003d req.environ[\u0027nova.context\u0027]"},{"line_number":88,"context_line":"        quotas \u003d QUOTAS.get_project_quotas(context, context.project_id,"},{"line_number":89,"context_line":"                                           usages\u003dFalse)"},{"line_number":90,"context_line":"        abs_limits \u003d dict((k, v[\u0027limit\u0027]) for k, v in quotas.items())"},{"line_number":91,"context_line":"        rate_limits \u003d req.environ.get(\"nova.limits\", [])"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        builder \u003d self._get_view_builder(req)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAHX%2F%2F62c%3D","line":90,"in_reply_to":"AAAAHX%2F%2F7BY%3D","updated":"2012-05-16 21:36:06.000000000","message":"v[\u0027limit\u0027] will always exist; that\u0027s part of the specification for get_project_quotas().","commit_id":"ed60a1497c4490b85273cec18e00cc2240f724cf"}],"nova/compute/api.py":[{"author":{"_account_id":688,"name":"Sandy Walsh","email":"sandy.walsh@rackspace.com","username":"sandy-walsh"},"change_message_id":"4b16b0e88d29dc4faa7a4fc1e7191190fb184e85","unresolved":false,"context_lines":[{"line_number":202,"context_line":"            # purposes"},{"line_number":203,"context_line":"            if \u0027injected_file_path_bytes\u0027 in exc.kwargs[\u0027overs\u0027]:"},{"line_number":204,"context_line":"                raise exception.OnsetFilePathLimitExceeded()"},{"line_number":205,"context_line":"            else:"},{"line_number":206,"context_line":"                raise exception.OnsetFileContentLimitExceeded()"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    def _check_num_instances_quota(self, context, instance_type, min_count,"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAHX%2F%2F7BQ%3D","line":205,"updated":"2012-05-16 17:47:42.000000000","message":"is the else: necessary?","commit_id":"ed60a1497c4490b85273cec18e00cc2240f724cf"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"4142ce2f01f8fb5aa5dd1828392be4a6a0a24fd9","unresolved":false,"context_lines":[{"line_number":202,"context_line":"            # purposes"},{"line_number":203,"context_line":"            if \u0027injected_file_path_bytes\u0027 in exc.kwargs[\u0027overs\u0027]:"},{"line_number":204,"context_line":"                raise exception.OnsetFilePathLimitExceeded()"},{"line_number":205,"context_line":"            else:"},{"line_number":206,"context_line":"                raise exception.OnsetFileContentLimitExceeded()"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    def _check_num_instances_quota(self, context, instance_type, min_count,"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAHX%2F%2F62Y%3D","line":205,"in_reply_to":"AAAAHX%2F%2F7BQ%3D","updated":"2012-05-16 21:36:06.000000000","message":"Yes; we have to raise the proper exception to match the old interface.","commit_id":"ed60a1497c4490b85273cec18e00cc2240f724cf"},{"author":{"_account_id":688,"name":"Sandy Walsh","email":"sandy.walsh@rackspace.com","username":"sandy-walsh"},"change_message_id":"4b16b0e88d29dc4faa7a4fc1e7191190fb184e85","unresolved":false,"context_lines":[{"line_number":237,"context_line":"            if allowed \u003c\u003d 0:"},{"line_number":238,"context_line":"                msg \u003d _(\"Cannot run any more instances of this type.\")"},{"line_number":239,"context_line":"                used \u003d max_count"},{"line_number":240,"context_line":"            elif min_count \u003c\u003d allowed \u003c\u003d max_count:"},{"line_number":241,"context_line":"                # We\u0027re actually OK, but still need reservations"},{"line_number":242,"context_line":"                return self._check_num_instances_quota(context, instance_type,"},{"line_number":243,"context_line":"                                                       min_count, allowed)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAHX%2F%2F7BE%3D","line":240,"updated":"2012-05-16 17:47:42.000000000","message":"Personally I\u0027d move this if outside of the the two error condition if/else. Keep the return paths clear.","commit_id":"ed60a1497c4490b85273cec18e00cc2240f724cf"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"4142ce2f01f8fb5aa5dd1828392be4a6a0a24fd9","unresolved":false,"context_lines":[{"line_number":237,"context_line":"            if allowed \u003c\u003d 0:"},{"line_number":238,"context_line":"                msg \u003d _(\"Cannot run any more instances of this type.\")"},{"line_number":239,"context_line":"                used \u003d max_count"},{"line_number":240,"context_line":"            elif min_count \u003c\u003d allowed \u003c\u003d max_count:"},{"line_number":241,"context_line":"                # We\u0027re actually OK, but still need reservations"},{"line_number":242,"context_line":"                return self._check_num_instances_quota(context, instance_type,"},{"line_number":243,"context_line":"                                                       min_count, allowed)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAHX%2F%2F62Q%3D","line":240,"in_reply_to":"AAAAHX%2F%2F7BE%3D","updated":"2012-05-16 21:36:06.000000000","message":"I thought about it.  I actually had it as a separate \"if\" before the \"if allowed…\" series.  I changed my mind because this reduced the number of tests and felt cleaner to me.  I think it basically comes down to an argument over style, here…","commit_id":"ed60a1497c4490b85273cec18e00cc2240f724cf"}],"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":2835,"name":"Brian Elliott","email":"bdelliott@gmail.com","username":"belliott"},"change_message_id":"3d31253232ba322d9aee52ef8a254446beb5875e","unresolved":false,"context_lines":[{"line_number":2543,"context_line":"                                                      session\u003dsession,"},{"line_number":2544,"context_line":"                                                      save\u003dFalse)"},{"line_number":2545,"context_line":"                refresh \u003d True"},{"line_number":2546,"context_line":"            elif usages[resource].in_use \u003c 0:"},{"line_number":2547,"context_line":"                # Negative in_use count indicates a desync, so try to"},{"line_number":2548,"context_line":"                # heal from that..."},{"line_number":2549,"context_line":"                refresh \u003d True"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAHX%2F%2F5Yw%3D","line":2546,"updated":"2012-05-21 22:22:38.000000000","message":"I like this healing stuff.  Pretty cool.  This function is a bit monolithic though.  It would be nice to see it pared down a bit.","commit_id":"aabe17cef4c07e0daffae4e0caa70102e2bfea0b"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"049e2f00a503cd8ef6f08935bb1463725c6c7265","unresolved":false,"context_lines":[{"line_number":2543,"context_line":"                                                      session\u003dsession,"},{"line_number":2544,"context_line":"                                                      save\u003dFalse)"},{"line_number":2545,"context_line":"                refresh \u003d True"},{"line_number":2546,"context_line":"            elif usages[resource].in_use \u003c 0:"},{"line_number":2547,"context_line":"                # Negative in_use count indicates a desync, so try to"},{"line_number":2548,"context_line":"                # heal from that..."},{"line_number":2549,"context_line":"                refresh \u003d True"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAHX%2F%2F5Xo%3D","line":2546,"in_reply_to":"AAAAHX%2F%2F5Yw%3D","updated":"2012-05-21 22:40:49.000000000","message":"Yeah, it is :/  Most of the monolith is comments, though, which makes it less bad.","commit_id":"aabe17cef4c07e0daffae4e0caa70102e2bfea0b"}],"nova/tests/api/openstack/compute/contrib/test_keypairs.py":[{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"change_message_id":"6f99c22186d555b15cc2d5d5c974514ca6ab81c7","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        self.assertFalse(\u0027private_key\u0027 in res_dict[\u0027keypair\u0027])"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def test_keypair_import_quota_limit(self):"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        def fake_quotas_count(self, context, resource, *args, **kwargs):"},{"line_number":170,"context_line":"            return 100"},{"line_number":171,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAHX%2F%2F6AY%3D","line":168,"updated":"2012-05-19 00:44:26.000000000","message":"Is there no test_keypair_create_quota_limit ?\n( May be this test should be added before this review request)","commit_id":"3db0879a93b036b4eb5c04f178f6133c9ddbd939"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"0fd99b9ab240540c9f4965625700d77aa5306fd0","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        self.assertFalse(\u0027private_key\u0027 in res_dict[\u0027keypair\u0027])"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def test_keypair_import_quota_limit(self):"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        def fake_quotas_count(self, context, resource, *args, **kwargs):"},{"line_number":170,"context_line":"            return 100"},{"line_number":171,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAHX%2F%2F5qw%3D","line":168,"in_reply_to":"AAAAHX%2F%2F6AY%3D","updated":"2012-05-21 14:19:34.000000000","message":"You would appear to be correct.  Keypairs were refactored into nova/compute/api.py while I was working on the quotas patch, and it appears that that refactor failed to include a test on creating a key pair.  (There also appears to be some left-over code in nova/api/ec2/cloud.py, but fixing that would be completely out of the scope of my patch ;)  Adding a test on creating a keypair should be incredibly straightforward, as basically it means using the same body but excluding \"public_key\"…I\u0027ll see about doing that in the next version of the patch.","commit_id":"3db0879a93b036b4eb5c04f178f6133c9ddbd939"}],"nova/volume/manager.py":[{"author":{"_account_id":475,"name":"Rick Harris","email":"rick.harris@rackspace.com","username":"rconradharris"},"change_message_id":"bf209cd1faacb64145a3deb57ab36c9cceb8af9a","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        # Get reservations"},{"line_number":193,"context_line":"        try:"},{"line_number":194,"context_line":"            reservations \u003d QUOTAS.reserve(context, volumes\u003d-1,"},{"line_number":195,"context_line":"                                          gigabytes\u003d-volume_ref[\u0027size\u0027])"},{"line_number":196,"context_line":"        except Exception:"},{"line_number":197,"context_line":"            reservations \u003d None"},{"line_number":198,"context_line":"            LOG.exception(_(\"Failed to update usages deleting volume\"))"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAHX%2F%2F7Ik%3D","line":195,"updated":"2012-05-16 16:28:44.000000000","message":"Have you thought about using a contextmanager here to automatically commit/rollback the reservation. Example:\n\n\nwith QUOTAS.reserve_transaction(args):\n    do_stuff...\n\nwhich does\n\ntry:\n   QUOTAS.reserve()\n   yield\nexcept:\n  QUOTAS.rollback()\nelse:\n   QUOTAS.commit()","commit_id":"ed60a1497c4490b85273cec18e00cc2240f724cf"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"4142ce2f01f8fb5aa5dd1828392be4a6a0a24fd9","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        # Get reservations"},{"line_number":193,"context_line":"        try:"},{"line_number":194,"context_line":"            reservations \u003d QUOTAS.reserve(context, volumes\u003d-1,"},{"line_number":195,"context_line":"                                          gigabytes\u003d-volume_ref[\u0027size\u0027])"},{"line_number":196,"context_line":"        except Exception:"},{"line_number":197,"context_line":"            reservations \u003d None"},{"line_number":198,"context_line":"            LOG.exception(_(\"Failed to update usages deleting volume\"))"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAHX%2F%2F62M%3D","line":195,"in_reply_to":"AAAAHX%2F%2F7Fg%3D","updated":"2012-05-16 21:36:06.000000000","message":"*nod*","commit_id":"ed60a1497c4490b85273cec18e00cc2240f724cf"},{"author":{"_account_id":475,"name":"Rick Harris","email":"rick.harris@rackspace.com","username":"rconradharris"},"change_message_id":"3b8d18d5eab158e80fba653afeb827137fffe545","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        # Get reservations"},{"line_number":193,"context_line":"        try:"},{"line_number":194,"context_line":"            reservations \u003d QUOTAS.reserve(context, volumes\u003d-1,"},{"line_number":195,"context_line":"                                          gigabytes\u003d-volume_ref[\u0027size\u0027])"},{"line_number":196,"context_line":"        except Exception:"},{"line_number":197,"context_line":"            reservations \u003d None"},{"line_number":198,"context_line":"            LOG.exception(_(\"Failed to update usages deleting volume\"))"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAHX%2F%2F7Fg%3D","line":195,"in_reply_to":"AAAAHX%2F%2F7Hc%3D","updated":"2012-05-16 16:52:41.000000000","message":"In the cases where the reserve/commit occur within the function, I think it could make it a little easier to follow, but def something we can consider for later if it makes sense.","commit_id":"ed60a1497c4490b85273cec18e00cc2240f724cf"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"57fcab72e90965dbac598ce0ffb18ef01f9f550d","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        # Get reservations"},{"line_number":193,"context_line":"        try:"},{"line_number":194,"context_line":"            reservations \u003d QUOTAS.reserve(context, volumes\u003d-1,"},{"line_number":195,"context_line":"                                          gigabytes\u003d-volume_ref[\u0027size\u0027])"},{"line_number":196,"context_line":"        except Exception:"},{"line_number":197,"context_line":"            reservations \u003d None"},{"line_number":198,"context_line":"            LOG.exception(_(\"Failed to update usages deleting volume\"))"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAHX%2F%2F7Hc%3D","line":195,"in_reply_to":"AAAAHX%2F%2F7Ik%3D","updated":"2012-05-16 16:43:46.000000000","message":"I think it did occur to me; the reason I didn\u0027t do this was because I had just as many places where commit()/rollback() were in a completely different function to begin with, and I had already written the bulk of the code…\n\n(As a side note, I also considered returning an object describing the reservations instead of a list, but the problem there is that I have to pass reservations across the RPC layer.  If I had done that, though, that would be a perfect candidate for a context manager…)","commit_id":"ed60a1497c4490b85273cec18e00cc2240f724cf"}]}
