)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"0ae7569aaf23c54d456c2d9481db5afdf03f5591","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Assaf Muller \u003camuller@redhat.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-05-08 15:26:28 -0400"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Extenuate register_dhcp_agent code duplication in tests"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Non-obvious changes:"},{"line_number":10,"context_line":"* Change helpers.register_agent to use a slimmed down version"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9a0c5dc1_5bfe3139","line":7,"updated":"2015-05-13 17:34:41.000000000","message":"(No action required) Extenuate -\u003e Reduce\n\n“The real problem in speech is not precise language. The problem is clear language.” —Richard Feynman","commit_id":"801dedebbfc7ff4ae6421c793a1154ca0d169e6c"}],"neutron/tests/common/helpers.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"ed38b14b1ab29069b8f6468a32ed9a84c75a6cf3","unresolved":false,"context_lines":[{"line_number":94,"context_line":"    agent \u003d _register_agent("},{"line_number":95,"context_line":"        _get_dhcp_agent_dict(host, networks))"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    if admin_state_up is False:"},{"line_number":98,"context_line":"        set_agent_admin_state_down(agent[\u0027id\u0027])"},{"line_number":99,"context_line":"    if alive is False:"},{"line_number":100,"context_line":"        kill_agent(agent[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"3acd31a7_20e4430b","line":97,"updated":"2015-05-04 07:16:37.000000000","message":"Given that you always pass bool, is there a reason to match on False identity here?\ni.e. why not\n\n if not admin_state_up:","commit_id":"745f27e18e41c547d88758798223aa5c1d2d9053"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"1d3f3b363dc226fdd6c1684d9e97473a75f517df","unresolved":false,"context_lines":[{"line_number":94,"context_line":"    agent \u003d _register_agent("},{"line_number":95,"context_line":"        _get_dhcp_agent_dict(host, networks))"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    if admin_state_up is False:"},{"line_number":98,"context_line":"        set_agent_admin_state_down(agent[\u0027id\u0027])"},{"line_number":99,"context_line":"    if alive is False:"},{"line_number":100,"context_line":"        kill_agent(agent[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aca2d91_98907a97","line":97,"in_reply_to":"3acd31a7_20e4430b","updated":"2015-05-08 19:25:16.000000000","message":"Let\u0027s just say that this revision was coded in a hurry :)","commit_id":"745f27e18e41c547d88758798223aa5c1d2d9053"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"ed38b14b1ab29069b8f6468a32ed9a84c75a6cf3","unresolved":false,"context_lines":[{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    if admin_state_up is False:"},{"line_number":98,"context_line":"        set_agent_admin_state_down(agent[\u0027id\u0027])"},{"line_number":99,"context_line":"    if alive is False:"},{"line_number":100,"context_line":"        kill_agent(agent[\u0027id\u0027])"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    return FakePlugin()._get_agent_by_type_and_host("}],"source_content_type":"text/x-python","patch_set":1,"id":"3acd31a7_00f387d7","line":99,"updated":"2015-05-04 07:16:37.000000000","message":"ditto","commit_id":"745f27e18e41c547d88758798223aa5c1d2d9053"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"1d3f3b363dc226fdd6c1684d9e97473a75f517df","unresolved":false,"context_lines":[{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    if admin_state_up is False:"},{"line_number":98,"context_line":"        set_agent_admin_state_down(agent[\u0027id\u0027])"},{"line_number":99,"context_line":"    if alive is False:"},{"line_number":100,"context_line":"        kill_agent(agent[\u0027id\u0027])"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    return FakePlugin()._get_agent_by_type_and_host("}],"source_content_type":"text/x-python","patch_set":1,"id":"1aca2d91_e9dd01e1","line":99,"in_reply_to":"3acd31a7_00f387d7","updated":"2015-05-08 19:25:16.000000000","message":"Done","commit_id":"745f27e18e41c547d88758798223aa5c1d2d9053"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"ed38b14b1ab29069b8f6468a32ed9a84c75a6cf3","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        context.get_admin_context(),"},{"line_number":109,"context_line":"        agent_id,"},{"line_number":110,"context_line":"        {\u0027agent\u0027: {"},{"line_number":111,"context_line":"            \u0027started_at\u0027: timeutils.utcnow() - datetime.timedelta(hours\u003d1),"},{"line_number":112,"context_line":"            \u0027heartbeat_timestamp\u0027:"},{"line_number":113,"context_line":"            timeutils.utcnow() - datetime.timedelta(hours\u003d1)}})"},{"line_number":114,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3acd31a7_c006afcd","line":111,"updated":"2015-05-04 07:16:37.000000000","message":"Consider creating a lambda object returning this difference and then just call it here and on L112.","commit_id":"745f27e18e41c547d88758798223aa5c1d2d9053"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"1d3f3b363dc226fdd6c1684d9e97473a75f517df","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        context.get_admin_context(),"},{"line_number":109,"context_line":"        agent_id,"},{"line_number":110,"context_line":"        {\u0027agent\u0027: {"},{"line_number":111,"context_line":"            \u0027started_at\u0027: timeutils.utcnow() - datetime.timedelta(hours\u003d1),"},{"line_number":112,"context_line":"            \u0027heartbeat_timestamp\u0027:"},{"line_number":113,"context_line":"            timeutils.utcnow() - datetime.timedelta(hours\u003d1)}})"},{"line_number":114,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1aca2d91_38872663","line":111,"in_reply_to":"1aca2d91_bd10c84f","updated":"2015-05-08 19:25:16.000000000","message":"Thanks for pointing this out. I did something slightly different but to the same effect. Aside from the duplication, I think it\u0027s incorrect to execute utcnow() twice, as started_at and heartbeat_timestamp in this case should have the exact same value.","commit_id":"745f27e18e41c547d88758798223aa5c1d2d9053"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"92850266395aa4c1c4cbf909a67b1e882201f744","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        context.get_admin_context(),"},{"line_number":109,"context_line":"        agent_id,"},{"line_number":110,"context_line":"        {\u0027agent\u0027: {"},{"line_number":111,"context_line":"            \u0027started_at\u0027: timeutils.utcnow() - datetime.timedelta(hours\u003d1),"},{"line_number":112,"context_line":"            \u0027heartbeat_timestamp\u0027:"},{"line_number":113,"context_line":"            timeutils.utcnow() - datetime.timedelta(hours\u003d1)}})"},{"line_number":114,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1aca2d91_bd10c84f","line":111,"in_reply_to":"3acd31a7_c006afcd","updated":"2015-05-06 15:09:10.000000000","message":"+1","commit_id":"745f27e18e41c547d88758798223aa5c1d2d9053"}],"neutron/tests/functional/scheduler/test_dhcp_agent_scheduler.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"0ae7569aaf23c54d456c2d9481db5afdf03f5591","unresolved":false,"context_lines":[{"line_number":168,"context_line":"                unscheduled_active_agents,"},{"line_number":169,"context_line":"                key\u003dattrgetter(\u0027load\u0027))[0:self.expected_scheduled_agent_count]"},{"line_number":170,"context_line":"            self.assertItemsEqual("},{"line_number":171,"context_line":"                (agent[\u0027id\u0027] for agent in actual_scheduled_agents),"},{"line_number":172,"context_line":"                (agent[\u0027id\u0027] for agent in sorted_unscheduled_active_agents))"},{"line_number":173,"context_line":"            self.assertEqual(self.expected_scheduled_agent_count,"},{"line_number":174,"context_line":"                             len(actual_scheduled_agents))"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a0c5dc1_d67c38ed","line":171,"updated":"2015-05-13 17:34:41.000000000","message":"(No action required) Consider changing actual_scheduled_agents to be scheduled_agent_ids on line 164 because no other attribute is used.","commit_id":"801dedebbfc7ff4ae6421c793a1154ca0d169e6c"}],"neutron/tests/unit/extensions/test_agent.py":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"4dce8c3d20f949647ac4ae4f0fd1f58827402c8d","unresolved":false,"context_lines":[{"line_number":169,"context_line":""},{"line_number":170,"context_line":"    def test_list_agent(self):"},{"line_number":171,"context_line":"        agents \u003d self._register_agent_states()"},{"line_number":172,"context_line":"        res \u003d self._list(\u0027agents\u0027)"},{"line_number":173,"context_line":"        for agt in res[\u0027agents\u0027]:"},{"line_number":174,"context_line":"            if (agt[\u0027host\u0027] \u003d\u003d DHCP_HOSTA and"},{"line_number":175,"context_line":"                agt[\u0027agent_type\u0027] \u003d\u003d constants.AGENT_TYPE_DHCP):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3acd31a7_f87cd473","side":"PARENT","line":172,"updated":"2015-05-01 22:10:29.000000000","message":"Unrelated change: These few lines are just dumb...","commit_id":"8c7bc3536b38350cffcc2932b576f4ace1e7b91c"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"92850266395aa4c1c4cbf909a67b1e882201f744","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            L3_HOSTA, constants.L3_AGENT_MODE_LEGACY)"},{"line_number":89,"context_line":"        l3_hostb \u003d helpers._get_l3_agent_dict("},{"line_number":90,"context_line":"            L3_HOSTB, constants.L3_AGENT_MODE_LEGACY)"},{"line_number":91,"context_line":"        dhcp_hosta \u003d helpers._get_dhcp_agent_dict(DHCP_HOSTA)"},{"line_number":92,"context_line":"        dhcp_hostc \u003d helpers._get_dhcp_agent_dict(DHCP_HOSTC)"},{"line_number":93,"context_line":"        helpers.register_l3_agent(host\u003dL3_HOSTA)"},{"line_number":94,"context_line":"        helpers.register_l3_agent(host\u003dL3_HOSTB)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aca2d91_bd6a0819","line":91,"updated":"2015-05-06 15:09:10.000000000","message":"(nit) The \u0027_\u0027 prefix that the function has implies it is internal to that file, but this suggests otherwise. Please remove the it.","commit_id":"745f27e18e41c547d88758798223aa5c1d2d9053"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"1d3f3b363dc226fdd6c1684d9e97473a75f517df","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            L3_HOSTA, constants.L3_AGENT_MODE_LEGACY)"},{"line_number":89,"context_line":"        l3_hostb \u003d helpers._get_l3_agent_dict("},{"line_number":90,"context_line":"            L3_HOSTB, constants.L3_AGENT_MODE_LEGACY)"},{"line_number":91,"context_line":"        dhcp_hosta \u003d helpers._get_dhcp_agent_dict(DHCP_HOSTA)"},{"line_number":92,"context_line":"        dhcp_hostc \u003d helpers._get_dhcp_agent_dict(DHCP_HOSTC)"},{"line_number":93,"context_line":"        helpers.register_l3_agent(host\u003dL3_HOSTA)"},{"line_number":94,"context_line":"        helpers.register_l3_agent(host\u003dL3_HOSTB)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aca2d91_f8f76ef3","line":91,"in_reply_to":"1aca2d91_bd6a0819","updated":"2015-05-08 19:25:16.000000000","message":"The underscore is meant to signal intent. In this case, I\u0027d like to keep the dict getter functions with the underscore. They\u0027re not meant to be used outside the helpers.py module, this function is poorly thought out but I don\u0027t want to include more refactors in this patch than necessary.","commit_id":"745f27e18e41c547d88758798223aa5c1d2d9053"}],"neutron/tests/unit/scheduler/test_dhcp_agent_scheduler.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"ed38b14b1ab29069b8f6468a32ed9a84c75a6cf3","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            agents.append(helpers.register_dhcp_agent("},{"line_number":53,"context_line":"                host,"},{"line_number":54,"context_line":"                admin_state_up\u003dadmin_state_up,"},{"line_number":55,"context_line":"                alive\u003dFalse if i \u003c down_agent_count else True))"},{"line_number":56,"context_line":"        return agents"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def _save_networks(self, networks):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3acd31a7_80279763","line":55,"updated":"2015-05-04 07:16:37.000000000","message":"I\u0027d recommend to create is_alive var (just for readability):\n\n is_alive \u003d i \u003e\u003d down_agent_count\n agents.append(...\n     alive\u003dis_alive)","commit_id":"745f27e18e41c547d88758798223aa5c1d2d9053"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"1d3f3b363dc226fdd6c1684d9e97473a75f517df","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            agents.append(helpers.register_dhcp_agent("},{"line_number":53,"context_line":"                host,"},{"line_number":54,"context_line":"                admin_state_up\u003dadmin_state_up,"},{"line_number":55,"context_line":"                alive\u003dFalse if i \u003c down_agent_count else True))"},{"line_number":56,"context_line":"        return agents"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def _save_networks(self, networks):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aca2d91_8c18db76","line":55,"in_reply_to":"1aca2d91_7defd0b0","updated":"2015-05-08 19:25:16.000000000","message":"Jeez reading back \u0027alive\u003dFalse if i \u003c down_agent_count else True\u0027 is comically stupid. Why not alive\u003di \u003e\u003d down_agent_count. Anyway I like Jakub\u0027s suggestion.","commit_id":"745f27e18e41c547d88758798223aa5c1d2d9053"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"92850266395aa4c1c4cbf909a67b1e882201f744","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            agents.append(helpers.register_dhcp_agent("},{"line_number":53,"context_line":"                host,"},{"line_number":54,"context_line":"                admin_state_up\u003dadmin_state_up,"},{"line_number":55,"context_line":"                alive\u003dFalse if i \u003c down_agent_count else True))"},{"line_number":56,"context_line":"        return agents"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def _save_networks(self, networks):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aca2d91_7defd0b0","line":55,"in_reply_to":"3acd31a7_80279763","updated":"2015-05-06 15:09:10.000000000","message":"(No action needed) If you don\u0027t go with the above suggestion, then a single list-comprehension can be used instead. It will be equally ambiguous :)","commit_id":"745f27e18e41c547d88758798223aa5c1d2d9053"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"4dce8c3d20f949647ac4ae4f0fd1f58827402c8d","unresolved":false,"context_lines":[{"line_number":298,"context_line":"        agents \u003d self.plugin.get_dhcp_agents_hosting_networks(self.ctx,"},{"line_number":299,"context_line":"                                                              [\u00271111\u0027])"},{"line_number":300,"context_line":"        self.assertEqual(0, len(agents))"},{"line_number":301,"context_line":""},{"line_number":302,"context_line":"    def test_scheduler_equal_distribution(self):"},{"line_number":303,"context_line":"        self._save_networks([\u00271111\u0027, \u00272222\u0027, \u00273333\u0027])"},{"line_number":304,"context_line":"        helpers.register_dhcp_agent(HOST_C)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3acd31a7_78c9e477","line":301,"updated":"2015-05-01 22:10:29.000000000","message":"Here the observant reader will notice that the \u0027schedule\u0027 calls use a new context and not self.ctx. The old test used self.ctx.session throughout, while the register_dhcp_agent helper used its own context. This meant that self.ctx did not see the updated agent objects when it called its schedule methods (sqlite uses repeated read and not read commited?). I could allow register_dhcp_agent to accept an optional context object, or, like I did here, use new contexts for certain DB calls.","commit_id":"745f27e18e41c547d88758798223aa5c1d2d9053"},{"author":{"_account_id":12444,"name":"John Schwarz","email":"jschwarz@redhat.com","username":"jschwarz"},"change_message_id":"92850266395aa4c1c4cbf909a67b1e882201f744","unresolved":false,"context_lines":[{"line_number":304,"context_line":"        helpers.register_dhcp_agent(HOST_C)"},{"line_number":305,"context_line":"        helpers.register_dhcp_agent(HOST_D, networks\u003d1)"},{"line_number":306,"context_line":"        self.plugin.network_scheduler.schedule("},{"line_number":307,"context_line":"            self.plugin, context.get_admin_context(), {\u0027id\u0027: \u00271111\u0027})"},{"line_number":308,"context_line":"        helpers.register_dhcp_agent(HOST_D, networks\u003d2)"},{"line_number":309,"context_line":"        self.plugin.network_scheduler.schedule("},{"line_number":310,"context_line":"            self.plugin, context.get_admin_context(), {\u0027id\u0027: \u00272222\u0027})"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aca2d91_9daaac18","line":307,"updated":"2015-05-06 15:09:10.000000000","message":"(No action needed) These should have been constants long ago. Now look where we are :(","commit_id":"745f27e18e41c547d88758798223aa5c1d2d9053"}]}
