)]}'
{"quantum/plugins/openvswitch/ovs_quantum_plugin.py":[{"author":{"_account_id":2170,"name":"Dave Lapsley","email":"david.lapsley@metacloud.com","username":"dlapsley"},"change_message_id":"7a552e5128c6883c4b5d8ea349b50acb7ebfa464","unresolved":false,"context_lines":[{"line_number":66,"context_line":"            return None"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def release(self, network_id):"},{"line_number":69,"context_line":"        for vlan in self.vlans.keys():"},{"line_number":70,"context_line":"            if self.vlans[vlan] \u003d\u003d network_id:"},{"line_number":71,"context_line":"                self.free_vlans.add(vlan)"},{"line_number":72,"context_line":"                del self.vlans[vlan]"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAD3%2F%2F9nA%3D","line":69,"updated":"2012-01-16 23:06:15.000000000","message":"Wondering if this linear lookup would become painful when a large proportion of vlans have been allocated. Is it worth keeping  map of network-id to vlan to speedup deletes at the expense of doubling memory?","commit_id":"cc11bc7fb3ff8c7deab07dc61ac5e248c80b7921"},{"author":{"_account_id":1726,"name":"Ghe Rivero","email":"ghe.rivero@gmail.com","username":"ghe.rivero"},"unresolved":false,"context_lines":[{"line_number":66,"context_line":"            return None"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def release(self, network_id):"},{"line_number":69,"context_line":"        for vlan in self.vlans.keys():"},{"line_number":70,"context_line":"            if self.vlans[vlan] \u003d\u003d network_id:"},{"line_number":71,"context_line":"                self.free_vlans.add(vlan)"},{"line_number":72,"context_line":"                del self.vlans[vlan]"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAD3%2F%2F9dU%3D","line":69,"in_reply_to":"AAAAD3%2F%2F9nA%3D","updated":"2012-01-17 06:23:52.000000000","message":"I\u0027ll give it a look today to avoid it, but i don\u0027t know if it will worth it since there will only be 4094 vlans at most. I\u0027m looking forward to VXLAN to avoid such a limitation :)","commit_id":"cc11bc7fb3ff8c7deab07dc61ac5e248c80b7921"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":57,"context_line":"        try:"},{"line_number":58,"context_line":"            vlan \u003d self.free_vlans.pop()"},{"line_number":59,"context_line":"            self.vlans[vlan] \u003d network_id"},{"line_number":60,"context_line":"            self.net_ids[network_id] \u003d vlan"},{"line_number":61,"context_line":"            # LOG.debug(\"VlanMap::acquire %s -\u003e %s\" % (x, network_id))"},{"line_number":62,"context_line":"            return vlan"},{"line_number":63,"context_line":"        except KeyError:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAD3%2F%2F7xQ%3D","line":60,"updated":"2012-01-21 07:51:59.000000000","message":"this could just call set_vlan(), right?","commit_id":"31224120189e05780bd5d100e453a995ea569603"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":61,"context_line":"            # LOG.debug(\"VlanMap::acquire %s -\u003e %s\" % (x, network_id))"},{"line_number":62,"context_line":"            return vlan"},{"line_number":63,"context_line":"        except KeyError:"},{"line_number":64,"context_line":"            raise Exception(\"No free vlans..\")"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    def get(self, vlan_id):"},{"line_number":67,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAD3%2F%2F7xM%3D","line":64,"updated":"2012-01-21 07:51:59.000000000","message":"I think it would be more clear to the reader if we just checked if the len(free_vlans) was zero, and if so, raised an exception","commit_id":"31224120189e05780bd5d100e453a995ea569603"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":67,"context_line":"        try:"},{"line_number":68,"context_line":"            return self.vlans[vlan_id]"},{"line_number":69,"context_line":"        except KeyError:"},{"line_number":70,"context_line":"            return None"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"    def release(self, network_id):"},{"line_number":73,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAD3%2F%2F7xI%3D","line":70,"updated":"2012-01-21 07:51:59.000000000","message":"this could more concisely be written: \n\nreturn self.vlans.get(vlan_id, None)","commit_id":"31224120189e05780bd5d100e453a995ea569603"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":80,"context_line":"            del self.vlans[vlan]"},{"line_number":81,"context_line":"            del self.net_ids[network_id]"},{"line_number":82,"context_line":"            # LOG.debug(\"VlanMap::release %s\" % (vlan))"},{"line_number":83,"context_line":"            return"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"class OVSQuantumPlugin(QuantumPluginBase):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAD3%2F%2F7xE%3D","line":83,"updated":"2012-01-21 07:51:59.000000000","message":"this method would flow a bit better if the lines after \"if vlan\" where just within the try-block, as there would be no need for s separate check, or either of the return lines.  \n\nAlso, while its not a problem assuming we initialize the set of VLANS to be only between 2 and 4095, but if zero was every a valid vlan, just checking \"if vlan\" would evaluate to false.  Should instead check \"if vlan is None\".","commit_id":"31224120189e05780bd5d100e453a995ea569603"}],"quantum/plugins/openvswitch/tests/unit/test_vlan_map.py":[{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":15,"context_line":"#    under the License."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import unittest"},{"line_number":18,"context_line":"import random"},{"line_number":19,"context_line":"from ovs_quantum_plugin import VlanMap"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAD3%2F%2F7xU%3D","line":18,"updated":"2012-01-21 07:51:59.000000000","message":"this import seems unneeded.","commit_id":"31224120189e05780bd5d100e453a995ea569603"}]}
