)]}'
{"nova/compute/manager.py":[{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"f41decf8f65b200dd167699e0199fa5dfc7f01ec","unresolved":false,"context_lines":[{"line_number":874,"context_line":"        \"\"\"This call passes straight through to the virtualization driver.\"\"\""},{"line_number":875,"context_line":"        return self.driver.refresh_provider_fw_rules()"},{"line_number":876,"context_line":""},{"line_number":877,"context_line":"    @utils.lock_instance(\u0027nw_cache\u0027)"},{"line_number":878,"context_line":"    def _get_instance_nw_info(self, context, instance, use_slave\u003dFalse):"},{"line_number":879,"context_line":"        \"\"\"Get a list of dictionaries of network data of an instance.\"\"\""},{"line_number":880,"context_line":"        if (not hasattr(instance, \u0027system_metadata\u0027) or"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2FXIg%3D","line":877,"updated":"2014-01-14 17:03:29.000000000","message":"Do we really need a new decorator here ?  Feels like this could be handled with an inner function wrapped with  \n\n@synchronized(instance.uuid ++ \".nw_cache\")\n\nwhich would be more consistent with other locking in compute/manager.   \n\nSee also:  https://review.openstack.org/#/c/55419/4/nova/compute/manager.py","commit_id":"ca1c5f6310a9b16d31c689139e66391b12ba78c8"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"45132b4ad44a9f3397bc23e05becaa6dc63ea4f2","unresolved":false,"context_lines":[{"line_number":874,"context_line":"        \"\"\"This call passes straight through to the virtualization driver.\"\"\""},{"line_number":875,"context_line":"        return self.driver.refresh_provider_fw_rules()"},{"line_number":876,"context_line":""},{"line_number":877,"context_line":"    @utils.lock_instance(\u0027nw_cache\u0027)"},{"line_number":878,"context_line":"    def _get_instance_nw_info(self, context, instance, use_slave\u003dFalse):"},{"line_number":879,"context_line":"        \"\"\"Get a list of dictionaries of network data of an instance.\"\"\""},{"line_number":880,"context_line":"        if (not hasattr(instance, \u0027system_metadata\u0027) or"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2FWRM%3D","line":877,"in_reply_to":"AAAAUH%2F%2FXIg%3D","updated":"2014-01-15 21:09:15.000000000","message":"Hi Phil, \n\nIn order to do this we\u0027d need to change this function to: \n\n\ndef _get_instance_nw_info(self, context, instance, use_slave\u003dFalse):\n     @synchronized(instance.uuid ++ \".nw_cache\")\n     def _do_get_instance_nw_info(self, context, use_false\u003dFalse):\n           blah;;;;\n     self._do_get_instance_nw_info(self, context, use_false)\n\n\nI\u0027m okay with using this approach instead but I wanted to avoid adding the inline function","commit_id":"ca1c5f6310a9b16d31c689139e66391b12ba78c8"},{"author":{"_account_id":10583,"name":"Praveen Yalagandula","email":"ypraveen@gmail.com","username":"ypraveen"},"change_message_id":"a7055c6bc60929415951b9f7040de5da14d537a7","unresolved":false,"context_lines":[{"line_number":1128,"context_line":"    def _get_instance_nw_info(self, context, instance, use_slave\u003dFalse):"},{"line_number":1129,"context_line":"        \"\"\"Get a list of dictionaries of network data of an instance.\"\"\""},{"line_number":1130,"context_line":""},{"line_number":1131,"context_line":"        @utils.synchronized(instance[\u0027uuid\u0027] + \".nw_cache\")"},{"line_number":1132,"context_line":"        def do_get_instance_nw_info(context, instance, use_slave):"},{"line_number":1133,"context_line":"            if (not hasattr(instance, \u0027system_metadata\u0027) or"},{"line_number":1134,"context_line":"                    len(instance[\u0027system_metadata\u0027]) \u003d\u003d 0):"}],"source_content_type":"text/x-python","patch_set":9,"id":"1ae5cdf2_7c187a75","line":1131,"updated":"2014-06-11 01:54:56.000000000","message":"Instead of decorator for locking in this case, straightaway using nova.openstack.common.lockutils.lock would simplify the code:\n\nwith lock(instance[\u0027uuid\u0027] + \".nw_cache\"):\n      if (not hasattr....","commit_id":"69c1118b95fde5f076ecbe33624ddfb45adda2c6"},{"author":{"_account_id":10583,"name":"Praveen Yalagandula","email":"ypraveen@gmail.com","username":"ypraveen"},"change_message_id":"d452a87211b8a8a3dddfd867c211bd1501ec2a37","unresolved":false,"context_lines":[{"line_number":1128,"context_line":"    def _get_instance_nw_info(self, context, instance, use_slave\u003dFalse):"},{"line_number":1129,"context_line":"        \"\"\"Get a list of dictionaries of network data of an instance.\"\"\""},{"line_number":1130,"context_line":""},{"line_number":1131,"context_line":"        @utils.synchronized(instance[\u0027uuid\u0027] + \".nw_cache\")"},{"line_number":1132,"context_line":"        def do_get_instance_nw_info(context, instance, use_slave):"},{"line_number":1133,"context_line":"            if (not hasattr(instance, \u0027system_metadata\u0027) or"},{"line_number":1134,"context_line":"                    len(instance[\u0027system_metadata\u0027]) \u003d\u003d 0):"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_91644c23","line":1131,"updated":"2014-06-11 06:04:08.000000000","message":"Instead of decorator for locking in this case, straightaway using nova.openstack.common.lockutils.lock would simplify the code:\nwith lock(instance[\u0027uuid\u0027] + \".nw_cache\"):\n      if (not hasattr....","commit_id":"3c90eec390c97ab6a4cc04aacd2b87eaa97591c9"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"2d4594b942b4cbf0e1514e5ce627e3a24688e877","unresolved":false,"context_lines":[{"line_number":1128,"context_line":"    def _get_instance_nw_info(self, context, instance, use_slave\u003dFalse):"},{"line_number":1129,"context_line":"        \"\"\"Get a list of dictionaries of network data of an instance.\"\"\""},{"line_number":1130,"context_line":""},{"line_number":1131,"context_line":"        @utils.synchronized(instance[\u0027uuid\u0027] + \".nw_cache\")"},{"line_number":1132,"context_line":"        def do_get_instance_nw_info(context, instance, use_slave):"},{"line_number":1133,"context_line":"            if (not hasattr(instance, \u0027system_metadata\u0027) or"},{"line_number":1134,"context_line":"                    len(instance[\u0027system_metadata\u0027]) \u003d\u003d 0):"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_d9124057","line":1131,"in_reply_to":"1ae5cdf2_91644c23","updated":"2014-06-19 16:34:09.000000000","message":"Right, I\u0027m confused why the lock utils can\u0027t be used here without building the subfunction","commit_id":"3c90eec390c97ab6a4cc04aacd2b87eaa97591c9"}],"nova/network/neutronv2/api.py":[{"author":{"_account_id":3217,"name":"Ian Wells","username":"ijw-ubuntu"},"change_message_id":"1dd7e53f5a4099167a64dbb11b0a452d46c45070","unresolved":false,"context_lines":[{"line_number":1057,"context_line":"                context, instance, networks, port_ids)"},{"line_number":1058,"context_line":"        nw_info \u003d network_model.NetworkInfo()"},{"line_number":1059,"context_line":""},{"line_number":1060,"context_line":"        for port_id in port_ids:"},{"line_number":1061,"context_line":"            for current_neutron_port in current_neutron_ports:"},{"line_number":1062,"context_line":"                if port_id \u003d\u003d current_neutron_port[\u0027id\u0027]:"},{"line_number":1063,"context_line":"                    network_IPs \u003d self._nw_info_get_ips(client,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAT3%2F%2FrhE%3D","line":1060,"updated":"2014-01-03 16:15:58.000000000","message":"This is the intersection of the lists (also, it\u0027s worked out at O(n*n), which sucks).  You need the set difference.  Some optimisation possible here (either by working them out simultaneously or extracting both to a helper function, which feels more right).","commit_id":"0a05104c25ccb16d92c8507a65b310d1892b9a64"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"599072371cc45583ed82e1d9198cdd1d2c1d6ac7","unresolved":false,"context_lines":[{"line_number":1057,"context_line":"                context, instance, networks, port_ids)"},{"line_number":1058,"context_line":"        nw_info \u003d network_model.NetworkInfo()"},{"line_number":1059,"context_line":""},{"line_number":1060,"context_line":"        for port_id in port_ids:"},{"line_number":1061,"context_line":"            for current_neutron_port in current_neutron_ports:"},{"line_number":1062,"context_line":"                if port_id \u003d\u003d current_neutron_port[\u0027id\u0027]:"},{"line_number":1063,"context_line":"                    network_IPs \u003d self._nw_info_get_ips(client,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2F6Iw%3D","line":1060,"in_reply_to":"AAAAT3%2F%2FrhE%3D","updated":"2014-01-06 23:05:18.000000000","message":"sure i\u0027ll refactor this to use a for else which seems better as well.","commit_id":"0a05104c25ccb16d92c8507a65b310d1892b9a64"},{"author":{"_account_id":3217,"name":"Ian Wells","username":"ijw-ubuntu"},"change_message_id":"1dd7e53f5a4099167a64dbb11b0a452d46c45070","unresolved":false,"context_lines":[{"line_number":1082,"context_line":"                        devname\u003ddevname))"},{"line_number":1083,"context_line":"                    break"},{"line_number":1084,"context_line":""},{"line_number":1085,"context_line":"        self._garbage_collect_instance_ports(instance, port_ids,"},{"line_number":1086,"context_line":"                                             current_neutron_ports,"},{"line_number":1087,"context_line":"                                             client)"},{"line_number":1088,"context_line":"        return nw_info"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAT3%2F%2FriA%3D","line":1085,"updated":"2014-01-03 16:15:58.000000000","message":"This adds a side-effect to a fairly pure function, and it\u0027s also not obvious why this is the right place to be doing garbage collection.  I understand that you need to run the garbage collection at a number of convenient moments but this is a bit of an obscure place to be putting it.  Is there anywhere better?","commit_id":"0a05104c25ccb16d92c8507a65b310d1892b9a64"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"599072371cc45583ed82e1d9198cdd1d2c1d6ac7","unresolved":false,"context_lines":[{"line_number":1082,"context_line":"                        devname\u003ddevname))"},{"line_number":1083,"context_line":"                    break"},{"line_number":1084,"context_line":""},{"line_number":1085,"context_line":"        self._garbage_collect_instance_ports(instance, port_ids,"},{"line_number":1086,"context_line":"                                             current_neutron_ports,"},{"line_number":1087,"context_line":"                                             client)"},{"line_number":1088,"context_line":"        return nw_info"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2F6NU%3D","line":1085,"in_reply_to":"AAAAT3%2F%2FriA%3D","updated":"2014-01-06 23:05:18.000000000","message":"This code here is run periodically from the heal task that runs in the background so this was the easiest place to add it.","commit_id":"0a05104c25ccb16d92c8507a65b310d1892b9a64"},{"author":{"_account_id":3217,"name":"Ian Wells","username":"ijw-ubuntu"},"change_message_id":"1dd7e53f5a4099167a64dbb11b0a452d46c45070","unresolved":false,"context_lines":[{"line_number":1086,"context_line":"                                             current_neutron_ports,"},{"line_number":1087,"context_line":"                                             client)"},{"line_number":1088,"context_line":"        return nw_info"},{"line_number":1089,"context_line":""},{"line_number":1090,"context_line":"    def _garbage_collect_instance_ports(self, instance, instance_port_ids,"},{"line_number":1091,"context_line":"                                        neutron_ports, client):"},{"line_number":1092,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAT3%2F%2FrjA%3D","line":1089,"updated":"2014-01-03 16:15:58.000000000","message":"Please add a comment that this is called with the nw_cache locked for the instance.  (And, ideally, a comments as to what the aim is here, i.e. to free any ports that are incorrectly allocated and why that might be so)","commit_id":"0a05104c25ccb16d92c8507a65b310d1892b9a64"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"599072371cc45583ed82e1d9198cdd1d2c1d6ac7","unresolved":false,"context_lines":[{"line_number":1086,"context_line":"                                             current_neutron_ports,"},{"line_number":1087,"context_line":"                                             client)"},{"line_number":1088,"context_line":"        return nw_info"},{"line_number":1089,"context_line":""},{"line_number":1090,"context_line":"    def _garbage_collect_instance_ports(self, instance, instance_port_ids,"},{"line_number":1091,"context_line":"                                        neutron_ports, client):"},{"line_number":1092,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2F6M8%3D","line":1089,"in_reply_to":"AAAAT3%2F%2FrjA%3D","updated":"2014-01-06 23:05:18.000000000","message":"Done","commit_id":"0a05104c25ccb16d92c8507a65b310d1892b9a64"},{"author":{"_account_id":3217,"name":"Ian Wells","username":"ijw-ubuntu"},"change_message_id":"1dd7e53f5a4099167a64dbb11b0a452d46c45070","unresolved":false,"context_lines":[{"line_number":1101,"context_line":"        \"\"\""},{"line_number":1102,"context_line":""},{"line_number":1103,"context_line":"        for neutron_port in neutron_ports:"},{"line_number":1104,"context_line":"            if neutron_port[\u0027id\u0027] not in instance_port_ids:"},{"line_number":1105,"context_line":"                client.delete_port(neutron_port[\u0027id\u0027])"},{"line_number":1106,"context_line":"                LOG.debug(_(\u0027Successfully garbaged collected port: %s\u0027) %"},{"line_number":1107,"context_line":"                          neutron_port[\u0027id\u0027], instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAT3%2F%2FrjI%3D","line":1104,"updated":"2014-01-03 16:15:58.000000000","message":"Pedantically, because on the likely number of ports it may make no difference, this is O(n*n) and a difference-then-loop would presumably be a little more efficient.  Also, per comment above, the calling function is already working out the intersection of the lists.","commit_id":"0a05104c25ccb16d92c8507a65b310d1892b9a64"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"599072371cc45583ed82e1d9198cdd1d2c1d6ac7","unresolved":false,"context_lines":[{"line_number":1101,"context_line":"        \"\"\""},{"line_number":1102,"context_line":""},{"line_number":1103,"context_line":"        for neutron_port in neutron_ports:"},{"line_number":1104,"context_line":"            if neutron_port[\u0027id\u0027] not in instance_port_ids:"},{"line_number":1105,"context_line":"                client.delete_port(neutron_port[\u0027id\u0027])"},{"line_number":1106,"context_line":"                LOG.debug(_(\u0027Successfully garbaged collected port: %s\u0027) %"},{"line_number":1107,"context_line":"                          neutron_port[\u0027id\u0027], instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2F6I4%3D","line":1104,"updated":"2014-01-06 23:05:18.000000000","message":"Sure i\u0027ll refactor this.","commit_id":"0a05104c25ccb16d92c8507a65b310d1892b9a64"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"b01b0b917c1a3c044a3e45855d81faff43f6028b","unresolved":false,"context_lines":[{"line_number":1055,"context_line":"                context, instance, networks, port_ids)"},{"line_number":1056,"context_line":"        nw_info \u003d network_model.NetworkInfo()"},{"line_number":1057,"context_line":""},{"line_number":1058,"context_line":"        for current_neutron_port in current_neutron_ports:"},{"line_number":1059,"context_line":"            for port_id in port_ids:"},{"line_number":1060,"context_line":"                if port_id \u003d\u003d current_neutron_port[\u0027id\u0027]:"},{"line_number":1061,"context_line":"                    network_IPs \u003d self._nw_info_get_ips(client,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2FuFI%3D","line":1058,"updated":"2014-01-09 08:12:04.000000000","message":"Would it be worthwhile doing some set operations here. That is:\n1. Create a set or current neutron port id\u0027s\n2. Union of the ports \u003d\u003e code from line 1061 - 1080\n3. ports_ids - set of current ports \u003d\u003e the ports that should be deleted\nMaybe it is an over kill but would save all of the loops","commit_id":"1419762f468033dfd73280a7da7a66f4a16f99e6"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"0d8ffc086deb724491224c917b0b0b1698300772","unresolved":false,"context_lines":[{"line_number":1055,"context_line":"                context, instance, networks, port_ids)"},{"line_number":1056,"context_line":"        nw_info \u003d network_model.NetworkInfo()"},{"line_number":1057,"context_line":""},{"line_number":1058,"context_line":"        for current_neutron_port in current_neutron_ports:"},{"line_number":1059,"context_line":"            for port_id in port_ids:"},{"line_number":1060,"context_line":"                if port_id \u003d\u003d current_neutron_port[\u0027id\u0027]:"},{"line_number":1061,"context_line":"                    network_IPs \u003d self._nw_info_get_ips(client,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2FrJI%3D","line":1058,"in_reply_to":"AAAAUH%2F%2FuFI%3D","updated":"2014-01-09 19:07:31.000000000","message":"I thought about doing this but since current_neutron_ports here is per instance based at most an instance will have 9 ports (depending on hypervisor limit).  Having another loop above this which creates a set() of port_ids from a list of dicts won\u0027t buy us anything as the N here is so small. It also adds an extra few lines of code to do this which makes this method look even more complex. \n\nI\u0027m happy to add a set() here though if you disagree though.","commit_id":"1419762f468033dfd73280a7da7a66f4a16f99e6"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"b01b0b917c1a3c044a3e45855d81faff43f6028b","unresolved":false,"context_lines":[{"line_number":1088,"context_line":"                # as the result of a timeout when initially trying to"},{"line_number":1089,"context_line":"                # create the port in neutron."},{"line_number":1090,"context_line":"                client.delete_port(current_neutron_port[\u0027id\u0027])"},{"line_number":1091,"context_line":"                LOG.debug(_(\u0027Successfully garbaged collected port: %s\u0027) %"},{"line_number":1092,"context_line":"                          current_neutron_port[\u0027id\u0027], instance\u003dinstance)"},{"line_number":1093,"context_line":"        return nw_info"},{"line_number":1094,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2FuH4%3D","line":1091,"updated":"2014-01-09 08:12:04.000000000","message":"please use a , instead of the %","commit_id":"1419762f468033dfd73280a7da7a66f4a16f99e6"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"0d8ffc086deb724491224c917b0b0b1698300772","unresolved":false,"context_lines":[{"line_number":1088,"context_line":"                # as the result of a timeout when initially trying to"},{"line_number":1089,"context_line":"                # create the port in neutron."},{"line_number":1090,"context_line":"                client.delete_port(current_neutron_port[\u0027id\u0027])"},{"line_number":1091,"context_line":"                LOG.debug(_(\u0027Successfully garbaged collected port: %s\u0027) %"},{"line_number":1092,"context_line":"                          current_neutron_port[\u0027id\u0027], instance\u003dinstance)"},{"line_number":1093,"context_line":"        return nw_info"},{"line_number":1094,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2FrIo%3D","line":1091,"in_reply_to":"AAAAUH%2F%2FuH4%3D","updated":"2014-01-09 19:07:31.000000000","message":"Done","commit_id":"1419762f468033dfd73280a7da7a66f4a16f99e6"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"f41decf8f65b200dd167699e0199fa5dfc7f01ec","unresolved":false,"context_lines":[{"line_number":1087,"context_line":"                # garbage collect this port as it was most likely created"},{"line_number":1088,"context_line":"                # as the result of a timeout when initially trying to"},{"line_number":1089,"context_line":"                # create the port in neutron."},{"line_number":1090,"context_line":"                client.delete_port(current_neutron_port[\u0027id\u0027])"},{"line_number":1091,"context_line":"                LOG.debug(_(\u0027Successfully garbaged collected port: %s\u0027),"},{"line_number":1092,"context_line":"                          current_neutron_port[\u0027id\u0027], instance\u003dinstance)"},{"line_number":1093,"context_line":"        return nw_info"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2FXGQ%3D","line":1090,"updated":"2014-01-14 17:03:29.000000000","message":"Because the list of ports is queried from Neutron using a client created with a admin\u003dTrue, and deleted with that client, it feels that there is a risk here that one project could end up deleting ports that belong to a different project.\n\nShould be some check here that the port does really belong to the same project as the instance","commit_id":"ca1c5f6310a9b16d31c689139e66391b12ba78c8"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"45132b4ad44a9f3397bc23e05becaa6dc63ea4f2","unresolved":false,"context_lines":[{"line_number":1087,"context_line":"                # garbage collect this port as it was most likely created"},{"line_number":1088,"context_line":"                # as the result of a timeout when initially trying to"},{"line_number":1089,"context_line":"                # create the port in neutron."},{"line_number":1090,"context_line":"                client.delete_port(current_neutron_port[\u0027id\u0027])"},{"line_number":1091,"context_line":"                LOG.debug(_(\u0027Successfully garbaged collected port: %s\u0027),"},{"line_number":1092,"context_line":"                          current_neutron_port[\u0027id\u0027], instance\u003dinstance)"},{"line_number":1093,"context_line":"        return nw_info"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2FQMM%3D","line":1090,"in_reply_to":"AAAAUH%2F%2FXGQ%3D","updated":"2014-01-15 21:09:15.000000000","message":"This would only happen if both projects have instances that shared the same instance_uuid which should definitely not happen.","commit_id":"ca1c5f6310a9b16d31c689139e66391b12ba78c8"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"ba9d7726c4cd0fe8de8566ef204a9c200a596403","unresolved":false,"context_lines":[{"line_number":202,"context_line":"        \"\"\""},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        @utils.synchronized(instance[\u0027uuid\u0027] + \".nw_cache\")"},{"line_number":205,"context_line":"        def do_allocate_for_instance(context, instance, **kwargs):"},{"line_number":206,"context_line":"            hypervisor_macs \u003d kwargs.get(\u0027macs\u0027, None)"},{"line_number":207,"context_line":"            available_macs \u003d None"},{"line_number":208,"context_line":"            if hypervisor_macs is not None:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUX%2F%2FM0A%3D","line":205,"updated":"2014-02-14 22:31:50.000000000","message":"Not crazy about the local method here, but that it matches the rest of nova code.  Creating a context manager here would be significantly cleaner and avoid adding more frames to the stack.  That type of refactor is outside the scope of this change.","commit_id":"a3f6e7621573bd67afd57b28d14a5edcc08fdd13"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"d1be1bcf1005a89ea7902422eb8a7f4a511bfe43","unresolved":false,"context_lines":[{"line_number":202,"context_line":"        \"\"\""},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        @utils.synchronized(instance[\u0027uuid\u0027] + \".nw_cache\")"},{"line_number":205,"context_line":"        def do_allocate_for_instance(context, instance, **kwargs):"},{"line_number":206,"context_line":"            hypervisor_macs \u003d kwargs.get(\u0027macs\u0027, None)"},{"line_number":207,"context_line":"            available_macs \u003d None"},{"line_number":208,"context_line":"            if hypervisor_macs is not None:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUX%2F%2FMmM%3D","line":205,"in_reply_to":"AAAAUX%2F%2FM0A%3D","updated":"2014-02-14 23:27:33.000000000","message":"I agree, in my first patch set i added a decorator that would avoid this local method though I think maintain that just to avoid the local method isn\u0027t worth it.","commit_id":"a3f6e7621573bd67afd57b28d14a5edcc08fdd13"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b9ef35f7bd606132176483988ae4d71851f8b492","unresolved":false,"context_lines":[{"line_number":202,"context_line":"        \"\"\""},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        @utils.synchronized(instance[\u0027uuid\u0027] + \".nw_cache\")"},{"line_number":205,"context_line":"        def do_allocate_for_instance(context, instance, **kwargs):"},{"line_number":206,"context_line":"            hypervisor_macs \u003d kwargs.get(\u0027macs\u0027, None)"},{"line_number":207,"context_line":"            available_macs \u003d None"},{"line_number":208,"context_line":"            if hypervisor_macs is not None:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUX%2F%2B0ww%3D","line":205,"updated":"2014-02-18 19:34:00.000000000","message":"Since the whole method here is run as synchronized, can\u0027t we just put the decorator on the toplevel or move the synchronized helper out to the same level? This just increases the nesting unnecessarily and makes the diff pretty awful.","commit_id":"37daa203837ffaaac6ca0e7ac547ae27f99e6fb3"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"6d8826b8fe0e4fec083a181c7d222eb31272f12f","unresolved":false,"context_lines":[{"line_number":202,"context_line":"        \"\"\""},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        @utils.synchronized(instance[\u0027uuid\u0027] + \".nw_cache\")"},{"line_number":205,"context_line":"        def do_allocate_for_instance(context, instance, **kwargs):"},{"line_number":206,"context_line":"            hypervisor_macs \u003d kwargs.get(\u0027macs\u0027, None)"},{"line_number":207,"context_line":"            available_macs \u003d None"},{"line_number":208,"context_line":"            if hypervisor_macs is not None:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUX%2F%2BzGU%3D","line":205,"in_reply_to":"AAAAUX%2F%2B0Yo%3D","updated":"2014-02-19 00:14:49.000000000","message":"I\u0027m nesting it so that this can be locked only per instance based and not for all instances (needs to be locked when the cache is being updated or when a new interface is being added to an instance so those don\u0027t occur at the same time and the port is deleted). \n\nIn my first patch I had added a new decorator that could handle this without the indent: https://review.openstack.org/#/c/64769/1/nova/utils.py . Perhaps a better approach is to have do_allocate_for_instance() call _do_allocate_for_instance and move the code below under that to avoid the extra indent.","commit_id":"37daa203837ffaaac6ca0e7ac547ae27f99e6fb3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a315e534b18f8cf063404974c800159af9c99c1d","unresolved":false,"context_lines":[{"line_number":202,"context_line":"        \"\"\""},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        @utils.synchronized(instance[\u0027uuid\u0027] + \".nw_cache\")"},{"line_number":205,"context_line":"        def do_allocate_for_instance(context, instance, **kwargs):"},{"line_number":206,"context_line":"            hypervisor_macs \u003d kwargs.get(\u0027macs\u0027, None)"},{"line_number":207,"context_line":"            available_macs \u003d None"},{"line_number":208,"context_line":"            if hypervisor_macs is not None:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUX%2F%2B0Yo%3D","line":205,"in_reply_to":"AAAAUX%2F%2B0ww%3D","updated":"2014-02-18 20:30:35.000000000","message":"+1, move the decorator to \"def allocate_for_instance\".  Are you nesting it so you can get at instance[\u0027uuid\u0027] easier?","commit_id":"37daa203837ffaaac6ca0e7ac547ae27f99e6fb3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a315e534b18f8cf063404974c800159af9c99c1d","unresolved":false,"context_lines":[{"line_number":355,"context_line":"                        raise exception.NoUniqueMatch("},{"line_number":356,"context_line":"                            _(\"Multiple security groups found matching\""},{"line_number":357,"context_line":"                              \" \u0027%s\u0027. Use an ID to be more specific.\") %"},{"line_number":358,"context_line":"                            security_group)"},{"line_number":359,"context_line":""},{"line_number":360,"context_line":"                    name_match \u003d user_security_group[\u0027id\u0027]"},{"line_number":361,"context_line":"                if user_security_group[\u0027id\u0027] \u003d\u003d security_group:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUX%2F%2B0YI%3D","line":358,"updated":"2014-02-18 20:30:35.000000000","message":"unrelated change, shouldn\u0027t be here","commit_id":"37daa203837ffaaac6ca0e7ac547ae27f99e6fb3"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"6d8826b8fe0e4fec083a181c7d222eb31272f12f","unresolved":false,"context_lines":[{"line_number":355,"context_line":"                        raise exception.NoUniqueMatch("},{"line_number":356,"context_line":"                            _(\"Multiple security groups found matching\""},{"line_number":357,"context_line":"                              \" \u0027%s\u0027. Use an ID to be more specific.\") %"},{"line_number":358,"context_line":"                            security_group)"},{"line_number":359,"context_line":""},{"line_number":360,"context_line":"                    name_match \u003d user_security_group[\u0027id\u0027]"},{"line_number":361,"context_line":"                if user_security_group[\u0027id\u0027] \u003d\u003d security_group:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUX%2F%2BzGI%3D","line":358,"in_reply_to":"AAAAUX%2F%2B0YI%3D","updated":"2014-02-19 00:14:49.000000000","message":"Done","commit_id":"37daa203837ffaaac6ca0e7ac547ae27f99e6fb3"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b9ef35f7bd606132176483988ae4d71851f8b492","unresolved":false,"context_lines":[{"line_number":1104,"context_line":"                    ovs_interfaceid\u003dovs_interfaceid,"},{"line_number":1105,"context_line":"                    devname\u003ddevname))"},{"line_number":1106,"context_line":"            else:"},{"line_number":1107,"context_line":"                # Note(arosen) if the port_id is not found in the nw_cache"},{"line_number":1108,"context_line":"                # we should garbage collect these ports as they were most"},{"line_number":1109,"context_line":"                # likely created as the result of a timeout when initially"},{"line_number":1110,"context_line":"                # trying to create the port in neutron."}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUX%2F%2B0vc%3D","line":1107,"updated":"2014-02-18 19:34:00.000000000","message":"Should be \"# NOTE\" AIUI","commit_id":"37daa203837ffaaac6ca0e7ac547ae27f99e6fb3"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"6d8826b8fe0e4fec083a181c7d222eb31272f12f","unresolved":false,"context_lines":[{"line_number":1104,"context_line":"                    ovs_interfaceid\u003dovs_interfaceid,"},{"line_number":1105,"context_line":"                    devname\u003ddevname))"},{"line_number":1106,"context_line":"            else:"},{"line_number":1107,"context_line":"                # Note(arosen) if the port_id is not found in the nw_cache"},{"line_number":1108,"context_line":"                # we should garbage collect these ports as they were most"},{"line_number":1109,"context_line":"                # likely created as the result of a timeout when initially"},{"line_number":1110,"context_line":"                # trying to create the port in neutron."}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUX%2F%2B0tY%3D","line":1107,"in_reply_to":"AAAAUX%2F%2B0vc%3D","updated":"2014-02-19 00:14:49.000000000","message":"Done","commit_id":"37daa203837ffaaac6ca0e7ac547ae27f99e6fb3"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b9ef35f7bd606132176483988ae4d71851f8b492","unresolved":false,"context_lines":[{"line_number":1110,"context_line":"                # trying to create the port in neutron."},{"line_number":1111,"context_line":"                try:"},{"line_number":1112,"context_line":"                    client.delete(current_neutron_port[\u0027id\u0027])"},{"line_number":1113,"context_line":"                    LOG.debug(_(\"Successfully garbaged collected port: %s\"),"},{"line_number":1114,"context_line":"                              current_neutron_port[\u0027id\u0027], instance\u003dinstance)"},{"line_number":1115,"context_line":"                except Exception:"},{"line_number":1116,"context_line":"                    LOG.exception(_(\"Failed to garbage collect port: %s\"),"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUX%2F%2B0vU%3D","line":1113,"updated":"2014-02-18 19:34:00.000000000","message":"Should be \"garbage-collected\"","commit_id":"37daa203837ffaaac6ca0e7ac547ae27f99e6fb3"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"6d8826b8fe0e4fec083a181c7d222eb31272f12f","unresolved":false,"context_lines":[{"line_number":1110,"context_line":"                # trying to create the port in neutron."},{"line_number":1111,"context_line":"                try:"},{"line_number":1112,"context_line":"                    client.delete(current_neutron_port[\u0027id\u0027])"},{"line_number":1113,"context_line":"                    LOG.debug(_(\"Successfully garbaged collected port: %s\"),"},{"line_number":1114,"context_line":"                              current_neutron_port[\u0027id\u0027], instance\u003dinstance)"},{"line_number":1115,"context_line":"                except Exception:"},{"line_number":1116,"context_line":"                    LOG.exception(_(\"Failed to garbage collect port: %s\"),"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUX%2F%2B0tU%3D","line":1113,"in_reply_to":"AAAAUX%2F%2B0vU%3D","updated":"2014-02-19 00:14:49.000000000","message":"Done","commit_id":"37daa203837ffaaac6ca0e7ac547ae27f99e6fb3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a315e534b18f8cf063404974c800159af9c99c1d","unresolved":false,"context_lines":[{"line_number":1113,"context_line":"                    LOG.debug(_(\"Successfully garbaged collected port: %s\"),"},{"line_number":1114,"context_line":"                              current_neutron_port[\u0027id\u0027], instance\u003dinstance)"},{"line_number":1115,"context_line":"                except Exception:"},{"line_number":1116,"context_line":"                    LOG.exception(_(\"Failed to garbage collect port: %s\"),"},{"line_number":1117,"context_line":"                                  current_neutron_port[\u0027id\u0027],"},{"line_number":1118,"context_line":"                                  instance\u003dinstance)"},{"line_number":1119,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUX%2F%2B0Ws%3D","line":1116,"updated":"2014-02-18 20:30:35.000000000","message":"Do we really want an error in the logs for this?  What can the admin do if they see this in the logs and it raises red flags?  If it\u0027s going to be an error, we should provide some wording on what they need to do, i.e. do they need to manually clean something up or look at the neutron logs for more details?","commit_id":"37daa203837ffaaac6ca0e7ac547ae27f99e6fb3"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"6d8826b8fe0e4fec083a181c7d222eb31272f12f","unresolved":false,"context_lines":[{"line_number":1113,"context_line":"                    LOG.debug(_(\"Successfully garbaged collected port: %s\"),"},{"line_number":1114,"context_line":"                              current_neutron_port[\u0027id\u0027], instance\u003dinstance)"},{"line_number":1115,"context_line":"                except Exception:"},{"line_number":1116,"context_line":"                    LOG.exception(_(\"Failed to garbage collect port: %s\"),"},{"line_number":1117,"context_line":"                                  current_neutron_port[\u0027id\u0027],"},{"line_number":1118,"context_line":"                                  instance\u003dinstance)"},{"line_number":1119,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUX%2F%2BzF0%3D","line":1116,"in_reply_to":"AAAAUX%2F%2B0Ws%3D","updated":"2014-02-19 00:14:49.000000000","message":"gotcha, yea they shouldn\u0027t need to manually clean anything as this will get run again in the periodic task. I\u0027ve found that adding these log statements are helpful to see why things fail especially in the gate. I\u0027ll change the wording and change this to LOG.warning  as that\u0027s probably better anyways.","commit_id":"37daa203837ffaaac6ca0e7ac547ae27f99e6fb3"},{"author":{"_account_id":10583,"name":"Praveen Yalagandula","email":"ypraveen@gmail.com","username":"ypraveen"},"change_message_id":"a7055c6bc60929415951b9f7040de5da14d537a7","unresolved":false,"context_lines":[{"line_number":210,"context_line":"            See nova/virt/driver.py:dhcp_options_for_instance for an example."},{"line_number":211,"context_line":"        \"\"\""},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"        @utils.synchronized(instance[\u0027uuid\u0027] + \".nw_cache\")"},{"line_number":214,"context_line":"        def do_allocate_for_instance(context, instance, **kwargs):"},{"line_number":215,"context_line":"            #NOTE(arosen): this code runs in a synchronize decorator because"},{"line_number":216,"context_line":"            # we need to to avoid a race condition where an instance\u0027s cache is"}],"source_content_type":"text/x-python","patch_set":9,"id":"1ae5cdf2_612ff7a1","line":213,"updated":"2014-06-11 01:54:56.000000000","message":"Instead of decorator for locking in this case, straightaway using nova.openstack.common.lockutils.lock would simplify the code:\n\nwith lock(instance[\u0027uuid\u0027] + \".nw_cache\"):\n      _do_allocate_for_instance(....)","commit_id":"69c1118b95fde5f076ecbe33624ddfb45adda2c6"},{"author":{"_account_id":10583,"name":"Praveen Yalagandula","email":"ypraveen@gmail.com","username":"ypraveen"},"change_message_id":"d452a87211b8a8a3dddfd867c211bd1501ec2a37","unresolved":false,"context_lines":[{"line_number":210,"context_line":"            See nova/virt/driver.py:dhcp_options_for_instance for an example."},{"line_number":211,"context_line":"        \"\"\""},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"        @utils.synchronized(instance[\u0027uuid\u0027] + \".nw_cache\")"},{"line_number":214,"context_line":"        def do_allocate_for_instance(context, instance, **kwargs):"},{"line_number":215,"context_line":"            #NOTE(arosen): this code runs in a synchronize decorator because"},{"line_number":216,"context_line":"            # we need to to avoid a race condition where an instance\u0027s cache is"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_f146707a","line":213,"updated":"2014-06-11 06:04:08.000000000","message":"Instead of decorator for locking in this case, straightaway using nova.openstack.common.lockutils.lock would simplify the code:\nwith lock(instance[\u0027uuid\u0027] + \".nw_cache\"):\n      _do_allocate_for_instance(....)","commit_id":"3c90eec390c97ab6a4cc04aacd2b87eaa97591c9"},{"author":{"_account_id":10583,"name":"Praveen Yalagandula","email":"ypraveen@gmail.com","username":"ypraveen"},"change_message_id":"0b23c8e180b7b6c5abd8138e6a314d9b738fb11d","unresolved":false,"context_lines":[{"line_number":210,"context_line":"            See nova/virt/driver.py:dhcp_options_for_instance for an example."},{"line_number":211,"context_line":"        \"\"\""},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"        @utils.synchronized(instance[\u0027uuid\u0027] + \".nw_cache\")"},{"line_number":214,"context_line":"        def do_allocate_for_instance(context, instance, **kwargs):"},{"line_number":215,"context_line":"            #NOTE(arosen): this code runs in a synchronize decorator because"},{"line_number":216,"context_line":"            # we need to to avoid a race condition where an instance\u0027s cache is"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_5e18edd2","line":213,"in_reply_to":"1ae5cdf2_0be46edf","updated":"2014-06-12 00:04:35.000000000","message":"I am not suggesting to get rid of the separate function for the real work. But I am suggesting that lines 213, 214, and 220 can be removed and replaced with that explicit call to lock().","commit_id":"3c90eec390c97ab6a4cc04aacd2b87eaa97591c9"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"fd0b160a8f9eb6afbfbe057e414f0267e4752aae","unresolved":false,"context_lines":[{"line_number":210,"context_line":"            See nova/virt/driver.py:dhcp_options_for_instance for an example."},{"line_number":211,"context_line":"        \"\"\""},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"        @utils.synchronized(instance[\u0027uuid\u0027] + \".nw_cache\")"},{"line_number":214,"context_line":"        def do_allocate_for_instance(context, instance, **kwargs):"},{"line_number":215,"context_line":"            #NOTE(arosen): this code runs in a synchronize decorator because"},{"line_number":216,"context_line":"            # we need to to avoid a race condition where an instance\u0027s cache is"}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_0be46edf","line":213,"in_reply_to":"1ae5cdf2_f146707a","updated":"2014-06-11 19:53:40.000000000","message":"That would work as well though I don\u0027t think using lock() direclty really simplifies the code really as we still need the nested function here so we don\u0027t have to  indent all the code over (In fact it adds another level of indent to this method using lock directly).","commit_id":"3c90eec390c97ab6a4cc04aacd2b87eaa97591c9"}],"nova/utils.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"b01b0b917c1a3c044a3e45855d81faff43f6028b","unresolved":false,"context_lines":[{"line_number":1141,"context_line":""},{"line_number":1142,"context_line":"def lock_instance(name):"},{"line_number":1143,"context_line":"    \"\"\""},{"line_number":1144,"context_line":"    Decorator used to create a lock for a particular instance and name."},{"line_number":1145,"context_line":""},{"line_number":1146,"context_line":"    Requires self, context, and instance as function args"},{"line_number":1147,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2FuII%3D","line":1144,"updated":"2014-01-09 08:12:04.000000000","message":"Should this not be:\n\"\"\"Decorator used ...","commit_id":"1419762f468033dfd73280a7da7a66f4a16f99e6"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"0d8ffc086deb724491224c917b0b0b1698300772","unresolved":false,"context_lines":[{"line_number":1141,"context_line":""},{"line_number":1142,"context_line":"def lock_instance(name):"},{"line_number":1143,"context_line":"    \"\"\""},{"line_number":1144,"context_line":"    Decorator used to create a lock for a particular instance and name."},{"line_number":1145,"context_line":""},{"line_number":1146,"context_line":"    Requires self, context, and instance as function args"},{"line_number":1147,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2FrIU%3D","line":1144,"in_reply_to":"AAAAUH%2F%2FuII%3D","updated":"2014-01-09 19:07:31.000000000","message":"Sure, fwiw I copied this method from here: https://github.com/openstack/nova/blob/master/nova/network/api.py#L41 which has the docstring formatted this way.","commit_id":"1419762f468033dfd73280a7da7a66f4a16f99e6"},{"author":{"_account_id":1501,"name":"Phil Day","email":"philip.day@hp.com","username":"philip-day"},"change_message_id":"f41decf8f65b200dd167699e0199fa5dfc7f01ec","unresolved":false,"context_lines":[{"line_number":1145,"context_line":"    return hashlib.md5(base_str).hexdigest()"},{"line_number":1146,"context_line":""},{"line_number":1147,"context_line":""},{"line_number":1148,"context_line":"def lock_instance(name):"},{"line_number":1149,"context_line":"    \"\"\"Decorator used to create a lock for a particular instance and name."},{"line_number":1150,"context_line":""},{"line_number":1151,"context_line":"    Requires self, context, and instance as function args"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2FXIU%3D","line":1148,"updated":"2014-01-14 17:03:29.000000000","message":"As per comments in manager.py I think you can avoid creating this new decorator","commit_id":"ca1c5f6310a9b16d31c689139e66391b12ba78c8"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"45132b4ad44a9f3397bc23e05becaa6dc63ea4f2","unresolved":false,"context_lines":[{"line_number":1145,"context_line":"    return hashlib.md5(base_str).hexdigest()"},{"line_number":1146,"context_line":""},{"line_number":1147,"context_line":""},{"line_number":1148,"context_line":"def lock_instance(name):"},{"line_number":1149,"context_line":"    \"\"\"Decorator used to create a lock for a particular instance and name."},{"line_number":1150,"context_line":""},{"line_number":1151,"context_line":"    Requires self, context, and instance as function args"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2FQMI%3D","line":1148,"in_reply_to":"AAAAUH%2F%2FXIU%3D","updated":"2014-01-15 21:09:15.000000000","message":"Done","commit_id":"ca1c5f6310a9b16d31c689139e66391b12ba78c8"}]}
