)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"afa287db6ac8dcdae128f7d182daee69000af6af","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Certain situations can cause the DHCP agent\u0027s local cache to get out"},{"line_number":10,"context_line":"of sync with the leases held internally by dnsmasq.  This method of"},{"line_number":11,"context_line":"detecting when to call dhcp_release is idempotent and not dependent on"},{"line_number":12,"context_line":"the cache.   It is more robust."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I4eafd9cfb94a77a2f0229f89de5483dad23725cf"},{"line_number":15,"context_line":"Closes-Bug: #1250644"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"AAAAUH%2F%2FnqA%3D","line":12,"updated":"2014-01-10 12:28:08.000000000","message":"for some reason it seems there are 3 whitespaces after the period","commit_id":"518b5cb23dd2eb5f35892b082f71bc5e94bec926"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"4ec208600cd1ce4909f7342cbd372710b7ca1f82","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Certain situations can cause the DHCP agent\u0027s local cache to get out"},{"line_number":10,"context_line":"of sync with the leases held internally by dnsmasq.  This method of"},{"line_number":11,"context_line":"detecting when to call dhcp_release is idempotent and not dependent on"},{"line_number":12,"context_line":"the cache.   It is more robust."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: I4eafd9cfb94a77a2f0229f89de5483dad23725cf"},{"line_number":15,"context_line":"Closes-Bug: #1250644"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"AAAAUH%2F%2Fdd4%3D","line":12,"in_reply_to":"AAAAUH%2F%2FnqA%3D","updated":"2014-01-13 17:19:16.000000000","message":"I was going for a pause for dramatic effect.  ;)  Just kidding.  I\u0027ll take out the space in the next patch set.","commit_id":"518b5cb23dd2eb5f35892b082f71bc5e94bec926"}],"neutron/agent/linux/dhcp.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"c9d49fbec9bfd4717ce620b40ec73211550fc761","unresolved":false,"context_lines":[{"line_number":367,"context_line":"            utils.execute(cmd, self.root_helper)"},{"line_number":368,"context_line":""},{"line_number":369,"context_line":"    def release_lease(self, mac_address, removed_ips):"},{"line_number":370,"context_line":"        pass"},{"line_number":371,"context_line":""},{"line_number":372,"context_line":"    def _release_lease(self, mac_address, removed_ips):"},{"line_number":373,"context_line":"        \"\"\"Release a DHCP lease.\"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2FJng%3D","line":370,"updated":"2013-11-13 18:49:16.000000000","message":"I noticed that the midonet driver also passes on release_lease.  However, I hesitated to change the interface for now.\n\nRemoving release_lease from the driver interface is something to consider.  It could result in removing a lot of code.","commit_id":"deb977a250ba8f0146cac3aa0381254c8cf1793e"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"fca513237633b3af7f75e3cb87f6164d1b307e19","unresolved":false,"context_lines":[{"line_number":367,"context_line":"            utils.execute(cmd, self.root_helper)"},{"line_number":368,"context_line":""},{"line_number":369,"context_line":"    def release_lease(self, mac_address, removed_ips):"},{"line_number":370,"context_line":"        pass"},{"line_number":371,"context_line":""},{"line_number":372,"context_line":"    def _release_lease(self, mac_address, removed_ips):"},{"line_number":373,"context_line":"        \"\"\"Release a DHCP lease.\"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F9%2FOc%3D","line":370,"in_reply_to":"AAAATn%2F%2BYHY%3D","updated":"2013-12-03 19:02:51.000000000","message":"I started this WIP to remove this method from the API and remove a bunch of code that should be obsoleted by that.  I thought that doing all of this in this patch was too far reaching for this patch.  I will complete this patch soon and I will add some of the midonet guys as reviewers to this patch.\n\nhttps://review.openstack.org/#/c/56285/","commit_id":"deb977a250ba8f0146cac3aa0381254c8cf1793e"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"change_message_id":"65cb558d1933591e57ec0d3c46708e5b695f5cc3","unresolved":false,"context_lines":[{"line_number":367,"context_line":"            utils.execute(cmd, self.root_helper)"},{"line_number":368,"context_line":""},{"line_number":369,"context_line":"    def release_lease(self, mac_address, removed_ips):"},{"line_number":370,"context_line":"        pass"},{"line_number":371,"context_line":""},{"line_number":372,"context_line":"    def _release_lease(self, mac_address, removed_ips):"},{"line_number":373,"context_line":"        \"\"\"Release a DHCP lease.\"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BYHY%3D","line":370,"in_reply_to":"AAAATn%2F%2FJng%3D","updated":"2013-11-26 18:37:49.000000000","message":"It looks like this method will be also unused.\nCould you discuss with Midonet guys if we can delete this method or not?\n\nhttps://github.com/openstack/neutron/blob/43b22ddb7d75eb5e596b5b35b6ffa78435def690/neutron/agent/dhcp_agent.py#L249","commit_id":"deb977a250ba8f0146cac3aa0381254c8cf1793e"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"c9d49fbec9bfd4717ce620b40ec73211550fc761","unresolved":false,"context_lines":[{"line_number":414,"context_line":"        r \u003d re.compile(\u0027[:.]\u0027)"},{"line_number":415,"context_line":"        buf \u003d StringIO.StringIO()"},{"line_number":416,"context_line":""},{"line_number":417,"context_line":"        filename \u003d self.get_conf_file_name(\u0027host\u0027)"},{"line_number":418,"context_line":"        old_leases \u003d self._read_old_leases(filename)"},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"        for port in self.network.ports:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2FJnE%3D","line":417,"updated":"2013-11-13 18:49:16.000000000","message":"Moving this line up here required me to rename \"name\" to something else because the variable \"name\" had a dual use in this method.","commit_id":"deb977a250ba8f0146cac3aa0381254c8cf1793e"},{"author":{"_account_id":2733,"name":"Darragh O\u0027Reilly","email":"doreilly@suse.com","username":"darragh-oreilly"},"change_message_id":"c774ca2ccfd5133b77865c89643df0a2408ed93c","unresolved":false,"context_lines":[{"line_number":438,"context_line":"                              (port.mac_address, name, alloc.ip_address))"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"        for ip, mac in old_leases.iteritems():"},{"line_number":441,"context_line":"            self._release_lease(mac, [ip])"},{"line_number":442,"context_line":""},{"line_number":443,"context_line":"        utils.replace_file(filename, buf.getvalue())"},{"line_number":444,"context_line":"        return filename"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BXoo%3D","line":441,"updated":"2013-11-26 20:30:37.000000000","message":"_release_lease() could be simplified as it only ever receives one ip in its removed_ips parameter.","commit_id":"deb977a250ba8f0146cac3aa0381254c8cf1793e"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"fca513237633b3af7f75e3cb87f6164d1b307e19","unresolved":false,"context_lines":[{"line_number":438,"context_line":"                              (port.mac_address, name, alloc.ip_address))"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"        for ip, mac in old_leases.iteritems():"},{"line_number":441,"context_line":"            self._release_lease(mac, [ip])"},{"line_number":442,"context_line":""},{"line_number":443,"context_line":"        utils.replace_file(filename, buf.getvalue())"},{"line_number":444,"context_line":"        return filename"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F9%2FIw%3D","line":441,"in_reply_to":"AAAATn%2F%2BXoo%3D","updated":"2013-12-03 19:02:51.000000000","message":"Done.  I hesitated to change it because it would require more changes to the method contents (beyond just the name change to _release_lease.)  I generally like to minimize changes.  However, in this case, the loop over a list of ips has become unnecessary with this patch and just complicates the code.\n\nI also had it in my head that changing this would be changing the API interface.  However, this patch makes the method private and stubs out the API method.  So, my concern there was not really valid.","commit_id":"deb977a250ba8f0146cac3aa0381254c8cf1793e"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"66c96a32b2b5352b3996e697d6d17a54e83babc4","unresolved":false,"context_lines":[{"line_number":437,"context_line":"                              (port.mac_address, name, alloc.ip_address))"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":"        for ip, mac in old_leases.iteritems():"},{"line_number":440,"context_line":"            self._release_lease(mac, ip)"},{"line_number":441,"context_line":""},{"line_number":442,"context_line":"        utils.replace_file(filename, buf.getvalue())"},{"line_number":443,"context_line":"        return filename"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F92Vc%3D","line":440,"updated":"2013-12-05 09:19:09.000000000","message":"This feels like an unexpected action here since the method name is output host file.  Should we add a separate call to get the diff between the files remove the leases and then move the new file in place?","commit_id":"dc016849ee5817659175590752e4c2812847d57d"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"1b561b7dabb19866c578689d79147c611a1b68b7","unresolved":false,"context_lines":[{"line_number":437,"context_line":"                              (port.mac_address, name, alloc.ip_address))"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":"        for ip, mac in old_leases.iteritems():"},{"line_number":440,"context_line":"            self._release_lease(mac, ip)"},{"line_number":441,"context_line":""},{"line_number":442,"context_line":"        utils.replace_file(filename, buf.getvalue())"},{"line_number":443,"context_line":"        return filename"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F9yr4%3D","line":440,"in_reply_to":"AAAATn%2F92Vc%3D","updated":"2013-12-05 21:13:05.000000000","message":"Let me know if patch set 3 is close to what you\u0027re thinking.","commit_id":"dc016849ee5817659175590752e4c2812847d57d"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"bcf9937cbce38a36068b6bfd3ef478cd42e6e6db","unresolved":false,"context_lines":[{"line_number":424,"context_line":"        utils.replace_file(name, buf.getvalue())"},{"line_number":425,"context_line":"        return name"},{"line_number":426,"context_line":""},{"line_number":427,"context_line":"    def _read_leases(self, filename):"},{"line_number":428,"context_line":"        leases \u003d set()"},{"line_number":429,"context_line":"        if os.path.exists(filename):"},{"line_number":430,"context_line":"            with open(filename) as f:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F9EDE%3D","line":427,"updated":"2013-12-17 06:17:08.000000000","message":"nitpick: The name should be symmetric to _outout_hosts_file.\n\u0027leases\u0027 here isn\u0027t consistent with other method names like release_lease, ...","commit_id":"dd00665233d3db41192d9bd52fa60161fb50acba"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"79c309333b4adc42b126f1d1d8561684349a087b","unresolved":false,"context_lines":[{"line_number":424,"context_line":"        utils.replace_file(name, buf.getvalue())"},{"line_number":425,"context_line":"        return name"},{"line_number":426,"context_line":""},{"line_number":427,"context_line":"    def _read_leases(self, filename):"},{"line_number":428,"context_line":"        leases \u003d set()"},{"line_number":429,"context_line":"        if os.path.exists(filename):"},{"line_number":430,"context_line":"            with open(filename) as f:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F86PU%3D","line":427,"in_reply_to":"AAAATn%2F9EDE%3D","updated":"2013-12-18 23:15:09.000000000","message":"Done","commit_id":"dd00665233d3db41192d9bd52fa60161fb50acba"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"bcf9937cbce38a36068b6bfd3ef478cd42e6e6db","unresolved":false,"context_lines":[{"line_number":439,"context_line":""},{"line_number":440,"context_line":"        self._output_hosts_file()"},{"line_number":441,"context_line":""},{"line_number":442,"context_line":"        new_leases \u003d self._read_leases(filename)"},{"line_number":443,"context_line":""},{"line_number":444,"context_line":"        for ip, mac in old_leases - new_leases:"},{"line_number":445,"context_line":"            self._release_lease(mac, ip)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F9EDM%3D","line":442,"updated":"2013-12-17 06:17:08.000000000","message":"It is non-sense to create file, read it again.\nnew_leases should be directly created by self.network.ports.","commit_id":"dd00665233d3db41192d9bd52fa60161fb50acba"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"79c309333b4adc42b126f1d1d8561684349a087b","unresolved":false,"context_lines":[{"line_number":439,"context_line":""},{"line_number":440,"context_line":"        self._output_hosts_file()"},{"line_number":441,"context_line":""},{"line_number":442,"context_line":"        new_leases \u003d self._read_leases(filename)"},{"line_number":443,"context_line":""},{"line_number":444,"context_line":"        for ip, mac in old_leases - new_leases:"},{"line_number":445,"context_line":"            self._release_lease(mac, ip)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F86Pg%3D","line":442,"in_reply_to":"AAAATn%2F9EDM%3D","updated":"2013-12-18 23:15:09.000000000","message":"Previous patches did generate it from self.network.ports. However, a recent change broke this out of _output_hosts_file in to this new method.\n\nThis method does save a bit of code complexity by reusing code.  But, I see your point.  Probably better to not read a file for information that is in memory.  I can work that up quickly and put it up to see if others like it better.","commit_id":"dd00665233d3db41192d9bd52fa60161fb50acba"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"afa287db6ac8dcdae128f7d182daee69000af6af","unresolved":false,"context_lines":[{"line_number":380,"context_line":"            utils.execute(cmd, self.root_helper)"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"    def release_lease(self, mac_address, removed_ips):"},{"line_number":383,"context_line":"        pass"},{"line_number":384,"context_line":""},{"line_number":385,"context_line":"    def _release_lease(self, mac_address, ip):"},{"line_number":386,"context_line":"        \"\"\"Release a DHCP lease.\"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2Fnoc%3D","line":383,"updated":"2014-01-10 12:28:08.000000000","message":"Not super excited about leaving a method just unimplemented like this.\n\nThis is used for instance, but the dhcp agent on a port_update_end. It is correct that now the same operation will be performed upon reload_allocations, but I think the right way to proceed would be to remove this method from the driver interface and update consumers accordingly.\n\nOtherwise at some point people will look, for instance, at release_lease_for_removed_ips and will wonder why it does nothing.","commit_id":"518b5cb23dd2eb5f35892b082f71bc5e94bec926"},{"author":{"_account_id":7183,"name":"Xu Han Peng","email":"xuhanp@linux.vnet.ibm.com","username":"xuhanp"},"change_message_id":"6fe49260a1f70c609d29647156d341fefe011a62","unresolved":false,"context_lines":[{"line_number":380,"context_line":"            utils.execute(cmd, self.root_helper)"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"    def release_lease(self, mac_address, removed_ips):"},{"line_number":383,"context_line":"        pass"},{"line_number":384,"context_line":""},{"line_number":385,"context_line":"    def _release_lease(self, mac_address, ip):"},{"line_number":386,"context_line":"        \"\"\"Release a DHCP lease.\"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2FgYY%3D","line":383,"in_reply_to":"AAAAUH%2F%2Fnoc%3D","updated":"2014-01-13 08:02:21.000000000","message":"Salvatore: I think Carl is trying to do this in a separate patch: https://review.openstack.org/#/c/56285/","commit_id":"518b5cb23dd2eb5f35892b082f71bc5e94bec926"},{"author":{"_account_id":8449,"name":"Marios Andreou","email":"marios.andreou@gmail.com","username":"marios"},"change_message_id":"2b929953b1820c64b163eed3fdcd1e6fcf3c6f82","unresolved":false,"context_lines":[{"line_number":381,"context_line":""},{"line_number":382,"context_line":"    def release_lease(self, mac_address, removed_ips):"},{"line_number":383,"context_line":"        pass"},{"line_number":384,"context_line":""},{"line_number":385,"context_line":"    def _release_lease(self, mac_address, ip):"},{"line_number":386,"context_line":"        \"\"\"Release a DHCP lease.\"\"\""},{"line_number":387,"context_line":"        cmd \u003d [\u0027dhcp_release\u0027, self.interface_name, ip, mac_address]"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2FfvE%3D","line":384,"updated":"2014-01-13 10:25:55.000000000","message":"thanks for the heads up - though imo the review dependency should be in the other direction, in which case the above wouldn\u0027t be there at all","commit_id":"518b5cb23dd2eb5f35892b082f71bc5e94bec926"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"4ec208600cd1ce4909f7342cbd372710b7ca1f82","unresolved":false,"context_lines":[{"line_number":381,"context_line":""},{"line_number":382,"context_line":"    def release_lease(self, mac_address, removed_ips):"},{"line_number":383,"context_line":"        pass"},{"line_number":384,"context_line":""},{"line_number":385,"context_line":"    def _release_lease(self, mac_address, ip):"},{"line_number":386,"context_line":"        \"\"\"Release a DHCP lease.\"\"\""},{"line_number":387,"context_line":"        cmd \u003d [\u0027dhcp_release\u0027, self.interface_name, ip, mac_address]"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2Fdho%3D","line":384,"in_reply_to":"AAAAUH%2F%2FfvE%3D","updated":"2014-01-13 17:19:16.000000000","message":"I disagree that the review dependency can or should be reversed.  This patch needs to go first because it renders the method obsolete.  Then, it can be removed.\n\nIf the method is removed first then leases will not be released until the second patch merges.  That is a problem.  I will not assume that dependent patches will be merged together or even close to each other.","commit_id":"518b5cb23dd2eb5f35892b082f71bc5e94bec926"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"afa287db6ac8dcdae128f7d182daee69000af6af","unresolved":false,"context_lines":[{"line_number":402,"context_line":"                        \u0027turned off DHCP: %s\u0027), self.network.id)"},{"line_number":403,"context_line":"            return"},{"line_number":404,"context_line":""},{"line_number":405,"context_line":"        self._output_hosts_file_and_release()"},{"line_number":406,"context_line":"        self._output_opts_file()"},{"line_number":407,"context_line":"        if self.active:"},{"line_number":408,"context_line":"            cmd \u003d [\u0027kill\u0027, \u0027-HUP\u0027, self.pid]"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2FnoI%3D","line":405,"updated":"2014-01-10 12:28:08.000000000","message":"Perhaps it would be cleaner to have two separate calls:\n\nself._release_unused_leases()\n\nand\n\nself._output_hosts_file","commit_id":"518b5cb23dd2eb5f35892b082f71bc5e94bec926"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"4ec208600cd1ce4909f7342cbd372710b7ca1f82","unresolved":false,"context_lines":[{"line_number":402,"context_line":"                        \u0027turned off DHCP: %s\u0027), self.network.id)"},{"line_number":403,"context_line":"            return"},{"line_number":404,"context_line":""},{"line_number":405,"context_line":"        self._output_hosts_file_and_release()"},{"line_number":406,"context_line":"        self._output_opts_file()"},{"line_number":407,"context_line":"        if self.active:"},{"line_number":408,"context_line":"            cmd \u003d [\u0027kill\u0027, \u0027-HUP\u0027, self.pid]"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2Fdeo%3D","line":405,"in_reply_to":"AAAAUH%2F%2FnoI%3D","updated":"2014-01-13 17:19:16.000000000","message":"Yeah, the way this review has evolved, that is the next logical step.  Makes sense to me.","commit_id":"518b5cb23dd2eb5f35892b082f71bc5e94bec926"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"change_message_id":"afa287db6ac8dcdae128f7d182daee69000af6af","unresolved":false,"context_lines":[{"line_number":456,"context_line":"                new_leases.add((alloc.ip_address, port.mac_address))"},{"line_number":457,"context_line":""},{"line_number":458,"context_line":"        for ip, mac in old_leases - new_leases:"},{"line_number":459,"context_line":"            self._release_lease(mac, ip)"},{"line_number":460,"context_line":""},{"line_number":461,"context_line":"        self._output_hosts_file()"},{"line_number":462,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2Fnn0%3D","line":459,"updated":"2014-01-10 12:28:08.000000000","message":"line 450-459 might be part of the _release_unused_leases method mentioned above","commit_id":"518b5cb23dd2eb5f35892b082f71bc5e94bec926"},{"author":{"_account_id":8449,"name":"Marios Andreou","email":"marios.andreou@gmail.com","username":"marios"},"change_message_id":"2b929953b1820c64b163eed3fdcd1e6fcf3c6f82","unresolved":false,"context_lines":[{"line_number":456,"context_line":"                new_leases.add((alloc.ip_address, port.mac_address))"},{"line_number":457,"context_line":""},{"line_number":458,"context_line":"        for ip, mac in old_leases - new_leases:"},{"line_number":459,"context_line":"            self._release_lease(mac, ip)"},{"line_number":460,"context_line":""},{"line_number":461,"context_line":"        self._output_hosts_file()"},{"line_number":462,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2FfwU%3D","line":459,"in_reply_to":"AAAAUH%2F%2Fnn0%3D","updated":"2014-01-13 10:25:55.000000000","message":"+1 to separation, especially as _output_hosts_file_and_release is actually just calling out to the _output_hosts_file as a separate method anyway. so just make this one about the release","commit_id":"518b5cb23dd2eb5f35892b082f71bc5e94bec926"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"e5b37502a2eb22388884831fcdefe0e54b1328c4","unresolved":false,"context_lines":[{"line_number":447,"context_line":"                    leases.add((host[2], host[0]))"},{"line_number":448,"context_line":"        return leases"},{"line_number":449,"context_line":""},{"line_number":450,"context_line":"    def _release_unused_leases(self):"},{"line_number":451,"context_line":"        filename \u003d self.get_conf_file_name(\u0027host\u0027)"},{"line_number":452,"context_line":"        old_leases \u003d self._read_hosts_file_leases(filename)"},{"line_number":453,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FQaA%3D","line":450,"updated":"2014-01-15 20:17:33.000000000","message":"We need to do this to handle cases where the dhcp-agent is reset right?","commit_id":"965542bfac90194bd032e5e6aeb6a507dcb11088"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"158eabaf1b0729c80b06da5e5fbfaccaac3679d2","unresolved":false,"context_lines":[{"line_number":447,"context_line":"                    leases.add((host[2], host[0]))"},{"line_number":448,"context_line":"        return leases"},{"line_number":449,"context_line":""},{"line_number":450,"context_line":"    def _release_unused_leases(self):"},{"line_number":451,"context_line":"        filename \u003d self.get_conf_file_name(\u0027host\u0027)"},{"line_number":452,"context_line":"        old_leases \u003d self._read_hosts_file_leases(filename)"},{"line_number":453,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2B0Os%3D","line":450,"in_reply_to":"AAAAUH%2F%2FQaA%3D","updated":"2014-01-21 20:03:46.000000000","message":"Right, that is one case that this catches.\n\nThe case that first motivated this change was actually when an RPC message to remove a port came after a full sync that deleted the port from the local cache.  The lease for the port was never released.  This method does not rely on the in-memory cache.","commit_id":"965542bfac90194bd032e5e6aeb6a507dcb11088"}],"neutron/tests/unit/test_linux_dhcp.py":[{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"change_message_id":"65cb558d1933591e57ec0d3c46708e5b695f5cc3","unresolved":false,"context_lines":[{"line_number":962,"context_line":"            mock_open.assert_called_once_with(\u0027/proc/5/cmdline\u0027, \u0027r\u0027)"},{"line_number":963,"context_line":""},{"line_number":964,"context_line":"    def test_output_hosts_file_release_leases(self):"},{"line_number":965,"context_line":"        dm \u003d dhcp.Dnsmasq(self.conf, FakeDualNetwork())"},{"line_number":966,"context_line":""},{"line_number":967,"context_line":"        dm._read_old_leases \u003d mock.Mock()"},{"line_number":968,"context_line":"        dm._read_old_leases.return_value \u003d {\u0027ip1\u0027: \u0027mac1\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BYIU%3D","line":965,"updated":"2013-11-26 18:37:49.000000000","message":"nit: i prefer dnsmasq \u003d","commit_id":"deb977a250ba8f0146cac3aa0381254c8cf1793e"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"fca513237633b3af7f75e3cb87f6164d1b307e19","unresolved":false,"context_lines":[{"line_number":962,"context_line":"            mock_open.assert_called_once_with(\u0027/proc/5/cmdline\u0027, \u0027r\u0027)"},{"line_number":963,"context_line":""},{"line_number":964,"context_line":"    def test_output_hosts_file_release_leases(self):"},{"line_number":965,"context_line":"        dm \u003d dhcp.Dnsmasq(self.conf, FakeDualNetwork())"},{"line_number":966,"context_line":""},{"line_number":967,"context_line":"        dm._read_old_leases \u003d mock.Mock()"},{"line_number":968,"context_line":"        dm._read_old_leases.return_value \u003d {\u0027ip1\u0027: \u0027mac1\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F9%2FHI%3D","line":965,"in_reply_to":"AAAATn%2F%2BYIU%3D","updated":"2013-12-03 19:02:51.000000000","message":"Agreed.  I had copy/pasted this from other nearby tests.\n\nDone","commit_id":"deb977a250ba8f0146cac3aa0381254c8cf1793e"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"change_message_id":"65cb558d1933591e57ec0d3c46708e5b695f5cc3","unresolved":false,"context_lines":[{"line_number":965,"context_line":"        dm \u003d dhcp.Dnsmasq(self.conf, FakeDualNetwork())"},{"line_number":966,"context_line":""},{"line_number":967,"context_line":"        dm._read_old_leases \u003d mock.Mock()"},{"line_number":968,"context_line":"        dm._read_old_leases.return_value \u003d {\u0027ip1\u0027: \u0027mac1\u0027,"},{"line_number":969,"context_line":"                                            \u0027ip2\u0027: \u0027mac2\u0027}"},{"line_number":970,"context_line":"        dm._release_lease \u003d mock.Mock()"},{"line_number":971,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2BYIM%3D","line":968,"updated":"2013-11-26 18:37:49.000000000","message":"nit I prefer using mac address than \u0027mac1\u0027","commit_id":"deb977a250ba8f0146cac3aa0381254c8cf1793e"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"fca513237633b3af7f75e3cb87f6164d1b307e19","unresolved":false,"context_lines":[{"line_number":965,"context_line":"        dm \u003d dhcp.Dnsmasq(self.conf, FakeDualNetwork())"},{"line_number":966,"context_line":""},{"line_number":967,"context_line":"        dm._read_old_leases \u003d mock.Mock()"},{"line_number":968,"context_line":"        dm._read_old_leases.return_value \u003d {\u0027ip1\u0027: \u0027mac1\u0027,"},{"line_number":969,"context_line":"                                            \u0027ip2\u0027: \u0027mac2\u0027}"},{"line_number":970,"context_line":"        dm._release_lease \u003d mock.Mock()"},{"line_number":971,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F9%2FHE%3D","line":968,"in_reply_to":"AAAATn%2F%2BYIM%3D","updated":"2013-12-03 19:02:51.000000000","message":"Done","commit_id":"deb977a250ba8f0146cac3aa0381254c8cf1793e"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"bcf9937cbce38a36068b6bfd3ef478cd42e6e6db","unresolved":false,"context_lines":[{"line_number":1010,"context_line":""},{"line_number":1011,"context_line":"        dnsmasq._release_lease.assert_has_calls([mock.call(mac2, ip2)],"},{"line_number":1012,"context_line":"                                                any_order\u003dTrue)"},{"line_number":1013,"context_line":""},{"line_number":1014,"context_line":"    def test_make_subnet_interface_ip_map(self):"},{"line_number":1015,"context_line":"        with mock.patch(\u0027neutron.agent.linux.ip_lib.IPDevice\u0027) as ip_dev:"},{"line_number":1016,"context_line":"            ip_dev.return_value.addr.list.return_value \u003d ["}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F9ECI%3D","line":1013,"updated":"2013-12-17 06:17:08.000000000","message":"unit test for _read_leases()","commit_id":"dd00665233d3db41192d9bd52fa60161fb50acba"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"79c309333b4adc42b126f1d1d8561684349a087b","unresolved":false,"context_lines":[{"line_number":1010,"context_line":""},{"line_number":1011,"context_line":"        dnsmasq._release_lease.assert_has_calls([mock.call(mac2, ip2)],"},{"line_number":1012,"context_line":"                                                any_order\u003dTrue)"},{"line_number":1013,"context_line":""},{"line_number":1014,"context_line":"    def test_make_subnet_interface_ip_map(self):"},{"line_number":1015,"context_line":"        with mock.patch(\u0027neutron.agent.linux.ip_lib.IPDevice\u0027) as ip_dev:"},{"line_number":1016,"context_line":"            ip_dev.return_value.addr.list.return_value \u003d ["}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F86FI%3D","line":1013,"in_reply_to":"AAAATn%2F9ECI%3D","updated":"2013-12-18 23:15:09.000000000","message":"Right, I\u0027ll admit that I punted on this one because I was not aware of how to mock open.  Thanks for the nudge.  I have discovered a few other examples in the same file.","commit_id":"dd00665233d3db41192d9bd52fa60161fb50acba"}]}
