)]}'
{"neutron/tests/common/exclusive_resources/ip_address.py":[{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"c07e5a493b9cfb0ec4ae6fe5a6cbe7083793f984","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class ExclusiveIPAddress(fixtures.Fixture):"},{"line_number":30,"context_line":"    def __init__(self, low, high):"},{"line_number":31,"context_line":"        self.ra \u003d resource_allocator.ResourceAllocator("},{"line_number":32,"context_line":"            \u0027ip_addresses\u0027,"},{"line_number":33,"context_line":"            functools.partial(get_random_ip, low, high))"},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_c9e98b1c","line":31,"range":{"start_line":31,"start_character":18,"end_line":31,"end_character":36},"updated":"2016-03-27 22:45:51.000000000","message":"there is no reason to define ra in __init__","commit_id":"a030c1f3f782271cd415cb8cfded8986a9460412"}],"neutron/tests/common/exclusive_resources/ip_network.py":[{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"c07e5a493b9cfb0ec4ae6fe5a6cbe7083793f984","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2016 Red Hat, Inc."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"},{"line_number":4,"context_line":"#    not use this file except in compliance with the License. You may obtain"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_e9cd6fb8","line":1,"updated":"2016-03-27 22:45:51.000000000","message":"IMo, this module should be merged with ip_addresses module","commit_id":"a030c1f3f782271cd415cb8cfded8986a9460412"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"601237d453bf80a1c8f7c56c328e3d850838c6a7","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"def _get_random_network(low, high, netmask):"},{"line_number":25,"context_line":"    ip \u003d ip_address.get_random_ip(low, high)"},{"line_number":26,"context_line":"    return str(netaddr.IPNetwork(\"%s/%s\" % (ip, netmask)).cidr)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class ExclusiveIPNetwork(fixtures.Fixture):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_c9d34b37","line":26,"updated":"2016-03-27 22:50:59.000000000","message":"this method can return \u002710.0.0.0/24\u0027 but also \u002710.0.0.1/24\u0027, perhaps better to return the following?\n\n cidr \u003d netaddr.IPNetwork(...)\n return \u0027%s/%s\u0027 % (cidr.network, cidr.prefixlen)","commit_id":"a030c1f3f782271cd415cb8cfded8986a9460412"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"e44e948eddb5e4a8f053574fd48beb8e762d3f56","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"def _get_random_network(low, high, netmask):"},{"line_number":25,"context_line":"    ip \u003d ip_address.get_random_ip(low, high)"},{"line_number":26,"context_line":"    return str(netaddr.IPNetwork(\"%s/%s\" % (ip, netmask)).cidr)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class ExclusiveIPNetwork(fixtures.Fixture):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_dc3db8bc","line":26,"in_reply_to":"da0c15f0_c9d34b37","updated":"2016-03-28 12:35:31.000000000","message":"No, it can\u0027t, the code returns IPNetwork(...).cidr, so it always returns a CIDR. It can\u0027t return 10.0.0.1/24.","commit_id":"a030c1f3f782271cd415cb8cfded8986a9460412"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"1944f79ea46366018556885a3b783744fed62948","unresolved":false,"context_lines":[{"line_number":23,"context_line":""},{"line_number":24,"context_line":"def _get_random_network(low, high, netmask):"},{"line_number":25,"context_line":"    ip \u003d ip_address.get_random_ip(low, high)"},{"line_number":26,"context_line":"    return str(netaddr.IPNetwork(\"%s/%s\" % (ip, netmask)).cidr)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class ExclusiveIPNetwork(fixtures.Fixture):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_fc219c4e","line":26,"in_reply_to":"da0c15f0_dc3db8bc","updated":"2016-03-28 12:38:37.000000000","message":"Great!","commit_id":"a030c1f3f782271cd415cb8cfded8986a9460412"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"c07e5a493b9cfb0ec4ae6fe5a6cbe7083793f984","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    return str(netaddr.IPNetwork(\"%s/%s\" % (ip, netmask)).cidr)"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class ExclusiveIPNetwork(fixtures.Fixture):"},{"line_number":30,"context_line":"    def __init__(self, low, high, netmask):"},{"line_number":31,"context_line":"        self.ra \u003d resource_allocator.ResourceAllocator("},{"line_number":32,"context_line":"            \u0027ip_networks\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_a985375a","line":29,"updated":"2016-03-27 22:45:51.000000000","message":"In neutron code, we common use \"cidr\" not \"network\"","commit_id":"a030c1f3f782271cd415cb8cfded8986a9460412"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"c07e5a493b9cfb0ec4ae6fe5a6cbe7083793f984","unresolved":false,"context_lines":[{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class ExclusiveIPNetwork(fixtures.Fixture):"},{"line_number":30,"context_line":"    def __init__(self, low, high, netmask):"},{"line_number":31,"context_line":"        self.ra \u003d resource_allocator.ResourceAllocator("},{"line_number":32,"context_line":"            \u0027ip_networks\u0027,"},{"line_number":33,"context_line":"            functools.partial(_get_random_network, low, high, netmask))"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_09f423f0","line":30,"range":{"start_line":30,"start_character":8,"end_line":30,"end_character":16},"updated":"2016-03-27 22:45:51.000000000","message":"itto","commit_id":"a030c1f3f782271cd415cb8cfded8986a9460412"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"601237d453bf80a1c8f7c56c328e3d850838c6a7","unresolved":false,"context_lines":[{"line_number":30,"context_line":"    def __init__(self, low, high, netmask):"},{"line_number":31,"context_line":"        self.ra \u003d resource_allocator.ResourceAllocator("},{"line_number":32,"context_line":"            \u0027ip_networks\u0027,"},{"line_number":33,"context_line":"            functools.partial(_get_random_network, low, high, netmask))"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def _setUp(self):"},{"line_number":36,"context_line":"        self.network \u003d netaddr.IPNetwork(self.ra.allocate())"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_a9d6d724","line":33,"range":{"start_line":33,"start_character":30,"end_line":33,"end_character":49},"updated":"2016-03-27 22:50:59.000000000","message":"Huhum, ResourceAllocator ensures resource uniqueness not no-overlapping between cidrs.","commit_id":"a030c1f3f782271cd415cb8cfded8986a9460412"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"c07e5a493b9cfb0ec4ae6fe5a6cbe7083793f984","unresolved":false,"context_lines":[{"line_number":33,"context_line":"            functools.partial(_get_random_network, low, high, netmask))"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def _setUp(self):"},{"line_number":36,"context_line":"        self.network \u003d netaddr.IPNetwork(self.ra.allocate())"},{"line_number":37,"context_line":"        self.addCleanup(self.ra.release, str(self.network))"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_e9444f1c","line":36,"updated":"2016-03-27 22:45:51.000000000","message":"You are using the same pattern in the 3 fixtures:\n\n self.\u003cresource\u003e \u003d func1(self.ra.allocate())\n self.addCleanup(self.ra.release, func2(self.\u003cresource\u003e))\n\n\nIt seems better to define a ResourceFixture fixture:\n\n class ResourceFixture(fixtures.Fixture):\n   def __init__(resource_name, allocator_func):\n     super().__init__()\n     ...\n   \n   def _setUp(self):\n     ra \u003d ResourceAllocator(self.resource_name, self.allocator_func)\n     self.resource \u003d ra.allocate()\n     self.addCleanup(self.ra.release, self.resource)\n\n\n class ExclusiveIPNetwork(...):\n   def __init__(self):\n      ...\n\n   def _setUp(self):\n     raw_cidr \u003d self.useFixture(ResourceFixture(\u0027cidr\u0027, ...)).resource\n     self.network \u003d netaddr.IPNetwork(raw_cidr)","commit_id":"a030c1f3f782271cd415cb8cfded8986a9460412"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"04f9db8f03231b7d8efa74d95c390db8ecf5b450","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        super(ExclusiveIPNetwork, self)._setUp()"},{"line_number":42,"context_line":"        self.network \u003d netaddr.IPNetwork(self.resource)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def is_valid(self, new_resource, allocated_resources):"},{"line_number":45,"context_line":"        new_ipset \u003d netaddr.IPSet([new_resource])"},{"line_number":46,"context_line":"        allocated_ipset \u003d netaddr.IPSet(allocated_resources)"},{"line_number":47,"context_line":"        return new_ipset.isdisjoint(allocated_ipset)"}],"source_content_type":"text/x-python","patch_set":4,"id":"da0c15f0_dcd93885","line":44,"updated":"2016-03-28 12:35:04.000000000","message":"Please see my comment in PS1, I don\u0027t think we need this.","commit_id":"f481c05d8008ebffb5c63f7cd9bf536f065ff3a2"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"f516fd7baf3cc4fe2b3c7cdcd85eaeef311217d7","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        super(ExclusiveIPNetwork, self)._setUp()"},{"line_number":42,"context_line":"        self.network \u003d netaddr.IPNetwork(self.resource)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def is_valid(self, new_resource, allocated_resources):"},{"line_number":45,"context_line":"        new_ipset \u003d netaddr.IPSet([new_resource])"},{"line_number":46,"context_line":"        allocated_ipset \u003d netaddr.IPSet(allocated_resources)"},{"line_number":47,"context_line":"        return new_ipset.isdisjoint(allocated_ipset)"}],"source_content_type":"text/x-python","patch_set":4,"id":"da0c15f0_1c1730ee","line":44,"in_reply_to":"da0c15f0_dcd93885","updated":"2016-03-28 12:38:40.000000000","message":"OK, there was some confusion here. Since _get_random_network returns IPNetwork(...).cidr it can only return CIDRs (Like 10.0.0.0/24, not 10.0.0.1/24). Currently we only generate /24s from a specific range, so we don\u0027t need is_valid. However, if at a later point we also generate other prefix lengths from the same range, we could get an overlap, so we do need this check for future proofing.","commit_id":"f481c05d8008ebffb5c63f7cd9bf536f065ff3a2"}],"neutron/tests/common/exclusive_resources/port.py":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"59154d33d20df68c29120bad736a63ea184731b4","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from neutron.tests.common import net_helpers"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"class ExclusivePort(resource_allocator.ResourceAllocator):"},{"line_number":22,"context_line":"    \"\"\"Allocate a unique port for a specific protocol."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"    :ivar port: allocated port"}],"source_content_type":"text/x-python","patch_set":4,"id":"da0c15f0_70edad24","line":21,"updated":"2016-03-28 14:01:13.000000000","message":"http://eavesdrop.openstack.org/irclogs/%23openstack-neutron/%23openstack-neutron.2016-03-28.log.html#t2016-03-28T13:56:27\n\nI\u0027ll follow up and decouple these classes / go back to using composition.","commit_id":"f481c05d8008ebffb5c63f7cd9bf536f065ff3a2"}],"neutron/tests/common/exclusive_resources/resource_allocator.py":[{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"eb2581b503193fe4aa2f322940a3c04314918478","unresolved":false,"context_lines":[{"line_number":66,"context_line":"    def _get_allocations(self):"},{"line_number":67,"context_line":"        utils.ensure_dir(TMP_DIR)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"        # Touch the file to ensure it exists"},{"line_number":70,"context_line":"        with open(self._state_file_path, \u0027a\u0027):"},{"line_number":71,"context_line":"            os.utime(self._state_file_path, None)"},{"line_number":72,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_49e8dbe2","line":69,"updated":"2016-03-27 22:55:59.000000000","message":"IMO, there is no reason to touch the file.","commit_id":"a030c1f3f782271cd415cb8cfded8986a9460412"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"1b2249aa290e8a151b040d9f9acf0e6a5beac48f","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def _setUp(self):"},{"line_number":45,"context_line":"        self.resource \u003d self.allocate()"},{"line_number":46,"context_line":"        self.addCleanup(self.release(self.resource))"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    @utils.synchronized(\u0027resource_allocator\u0027, external\u003dTrue, lock_path\u003d\u0027/tmp\u0027)"},{"line_number":49,"context_line":"    def allocate(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"da0c15f0_7d675325","line":46,"updated":"2016-03-28 08:36:03.000000000","message":"Either that or this is a very elaborate noop. :)","commit_id":"8924353a9163ea7176b5c9502f431aaf16d2290f"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"83a407537a11e1f836511fea05460f227673adbf","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":"    def _setUp(self):"},{"line_number":45,"context_line":"        self.resource \u003d self.allocate()"},{"line_number":46,"context_line":"        self.addCleanup(self.release(self.resource))"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"    @utils.synchronized(\u0027resource_allocator\u0027, external\u003dTrue, lock_path\u003d\u0027/tmp\u0027)"},{"line_number":49,"context_line":"    def allocate(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"da0c15f0_11ba896e","line":46,"updated":"2016-03-28 05:02:24.000000000","message":"i guess you mean self.addCleanup(self.release, self.resource)","commit_id":"8924353a9163ea7176b5c9502f431aaf16d2290f"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"393acf73e0681a7cc68e2689b6e639feb3e2ce64","unresolved":false,"context_lines":[{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        raise ValueError("},{"line_number":60,"context_line":"            \u0027Could not allocate a new resource using %s from pool %s\u0027 %"},{"line_number":61,"context_line":"            (self._allocator_function.__name__, allocations))"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"    @utils.synchronized(\u0027resource_allocator\u0027, external\u003dTrue, lock_path\u003d\u0027/tmp\u0027)"},{"line_number":64,"context_line":"    def release(self, resource):"}],"source_content_type":"text/x-python","patch_set":3,"id":"da0c15f0_ac753799","line":61,"range":{"start_line":61,"start_character":38,"end_line":61,"end_character":46},"updated":"2016-03-28 10:22:16.000000000","message":"functions created with functools.partial have no __name__ so we should not use it","commit_id":"8924353a9163ea7176b5c9502f431aaf16d2290f"}],"neutron/tests/fullstack/resources/config.py":[{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"c07e5a493b9cfb0ec4ae6fe5a6cbe7083793f984","unresolved":false,"context_lines":[{"line_number":83,"context_line":"        })"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def _setUp(self):"},{"line_number":86,"context_line":"        self.config[\u0027DEFAULT\u0027].update({"},{"line_number":87,"context_line":"            \u0027bind_port\u0027: self.useFixture("},{"line_number":88,"context_line":"                port.ExclusivePort(constants.PROTO_NAME_TCP)).port"},{"line_number":89,"context_line":"        })"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_29f5a7ca","line":86,"updated":"2016-03-27 22:45:51.000000000","message":"prefer:\n\n self.config[\u0027DEFAULT\u0027][\u0027bind_port\u0027] \u003d ...","commit_id":"a030c1f3f782271cd415cb8cfded8986a9460412"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"c07e5a493b9cfb0ec4ae6fe5a6cbe7083793f984","unresolved":false,"context_lines":[{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def _setUp(self):"},{"line_number":177,"context_line":"        if self.config[\u0027ovs\u0027][\u0027of_interface\u0027] \u003d\u003d \u0027native\u0027:"},{"line_number":178,"context_line":"            self.config[\u0027ovs\u0027].update({"},{"line_number":179,"context_line":"                \u0027of_listen_port\u0027: self.useFixture("},{"line_number":180,"context_line":"                    port.ExclusivePort(constants.PROTO_NAME_TCP)).port"},{"line_number":181,"context_line":"            })"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_8904b3c0","line":178,"updated":"2016-03-27 22:45:51.000000000","message":"itto","commit_id":"a030c1f3f782271cd415cb8cfded8986a9460412"}]}
