)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"17cd4197ae77e48b36f5129d17b31d1e2e362b2c","unresolved":false,"context_lines":[{"line_number":9,"context_line":"This patch adds a service which will populate neutron with information"},{"line_number":10,"context_line":"about each Ironic node\u0027s NIC to physnet mappings. This is required to"},{"line_number":11,"context_line":"fully support port binding when using routed networks."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I34f288b07833cbe8f5593e521263034def911faf"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":14,"id":"df87a7cf_4224abc6","line":12,"updated":"2017-12-15 03:53:24.000000000","message":"Is there a Related-Bug number?","commit_id":"4d3411525d68fc5b0b2039a423d3959f8c830624"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"31e05aebb7638bc339748e9c5aa978c37ad1f5da","unresolved":false,"context_lines":[{"line_number":9,"context_line":"This patch adds a service which will populate neutron with information"},{"line_number":10,"context_line":"about each Ironic node\u0027s NIC to physnet mappings. This is required to"},{"line_number":11,"context_line":"fully support port binding when using routed networks."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I34f288b07833cbe8f5593e521263034def911faf"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":14,"id":"df87a7cf_058649ba","line":12,"in_reply_to":"df87a7cf_4224abc6","updated":"2017-12-19 19:49:44.000000000","message":"Done","commit_id":"4d3411525d68fc5b0b2039a423d3959f8c830624"}],"doc/source/install/index.rst":[{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"17cd4197ae77e48b36f5129d17b31d1e2e362b2c","unresolved":false,"context_lines":[{"line_number":3,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":4,"context_line":""},{"line_number":5,"context_line":"This section describes how to install and configure the"},{"line_number":6,"context_line":"``networking-baremetal`` plugin and ``ironic-neutron-agent``."},{"line_number":7,"context_line":""},{"line_number":8,"context_line":"Install the networking-baremetal plugin and agent"},{"line_number":9,"context_line":"-------------------------------------------------"}],"source_content_type":"text/x-rst","patch_set":14,"id":"df87a7cf_05bf8dfb","line":6,"updated":"2017-12-15 03:53:24.000000000","message":"nit: at a glance, I\u0027m not groking why, which I think _might_ help people exploring, but just a thought.","commit_id":"4d3411525d68fc5b0b2039a423d3959f8c830624"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"31e05aebb7638bc339748e9c5aa978c37ad1f5da","unresolved":false,"context_lines":[{"line_number":3,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":4,"context_line":""},{"line_number":5,"context_line":"This section describes how to install and configure the"},{"line_number":6,"context_line":"``networking-baremetal`` plugin and ``ironic-neutron-agent``."},{"line_number":7,"context_line":""},{"line_number":8,"context_line":"Install the networking-baremetal plugin and agent"},{"line_number":9,"context_line":"-------------------------------------------------"}],"source_content_type":"text/x-rst","patch_set":14,"id":"df87a7cf_a0e2eb2e","line":6,"in_reply_to":"df87a7cf_05bf8dfb","updated":"2017-12-19 19:49:44.000000000","message":"I added a paragraph about the agent.\nI guess another one about the ML2 driver would make sense, but in a different review ...","commit_id":"4d3411525d68fc5b0b2039a423d3959f8c830624"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"6cdcb3b068b3c760f720b5a5735dc9c7ff3784bd","unresolved":false,"context_lines":[{"line_number":5,"context_line":"This section describes how to install and configure the"},{"line_number":6,"context_line":"``networking-baremetal`` plugin and ``ironic-neutron-agent``."},{"line_number":7,"context_line":""},{"line_number":8,"context_line":"The ``ironic-neutron-agent`` is a Neutron agent that populates the host to"},{"line_number":9,"context_line":"physical network mapping for baremetal nodes in neutron. Neutron uses this to"},{"line_number":10,"context_line":"calculate the segment to host mapping information."},{"line_number":11,"context_line":""}],"source_content_type":"text/x-rst","patch_set":16,"id":"df87a7cf_20425b69","line":8,"range":{"start_line":8,"start_character":34,"end_line":8,"end_character":41},"updated":"2018-01-07 21:42:34.000000000","message":"nit: neutron, to be consistent with line 9: \"in neutron\"","commit_id":"e6e5b6a8eeca262f47d272da5683ae27933a6e62"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"86427e06e43275b5c65456116b67d78b1b8d66b6","unresolved":false,"context_lines":[{"line_number":5,"context_line":"This section describes how to install and configure the"},{"line_number":6,"context_line":"``networking-baremetal`` plugin and ``ironic-neutron-agent``."},{"line_number":7,"context_line":""},{"line_number":8,"context_line":"The ``ironic-neutron-agent`` is a Neutron agent that populates the host to"},{"line_number":9,"context_line":"physical network mapping for baremetal nodes in neutron. Neutron uses this to"},{"line_number":10,"context_line":"calculate the segment to host mapping information."},{"line_number":11,"context_line":""}],"source_content_type":"text/x-rst","patch_set":16,"id":"9f91af0f_96fb8877","line":8,"range":{"start_line":8,"start_character":34,"end_line":8,"end_character":41},"in_reply_to":"df87a7cf_20425b69","updated":"2018-01-08 14:29:12.000000000","message":"Done","commit_id":"e6e5b6a8eeca262f47d272da5683ae27933a6e62"}],"networking_baremetal/agent/ironic_neutron_agent.py":[{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"3ae69ca654e783a796735ecd4a270ae6cb2f8a54","unresolved":false,"context_lines":[{"line_number":90,"context_line":""},{"line_number":91,"context_line":"class BaremetalNeutronAgent(object):"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def __init__(self, conf\u003dNone):"},{"line_number":94,"context_line":"        self.context \u003d context.get_admin_context_without_session()"},{"line_number":95,"context_line":"        self.state_rpc \u003d agent_rpc.PluginReportStateAPI(topics.REPORTS)"},{"line_number":96,"context_line":"        self.ironic_client \u003d get_client()"}],"source_content_type":"text/x-python","patch_set":12,"id":"df87a7cf_74dd5bde","line":93,"range":{"start_line":93,"start_character":23,"end_line":93,"end_character":32},"updated":"2017-12-11 16:33:57.000000000","message":"What is this for? It doesn\u0027t seem to be used.","commit_id":"2a801815cf5d4ac278c687c492b708deacdfaa10"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"9f0f4bc903b19ba5e5785606d272ad228c50c696","unresolved":false,"context_lines":[{"line_number":90,"context_line":""},{"line_number":91,"context_line":"class BaremetalNeutronAgent(object):"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"    def __init__(self, conf\u003dNone):"},{"line_number":94,"context_line":"        self.context \u003d context.get_admin_context_without_session()"},{"line_number":95,"context_line":"        self.state_rpc \u003d agent_rpc.PluginReportStateAPI(topics.REPORTS)"},{"line_number":96,"context_line":"        self.ironic_client \u003d get_client()"}],"source_content_type":"text/x-python","patch_set":12,"id":"df87a7cf_6a1af417","line":93,"range":{"start_line":93,"start_character":23,"end_line":93,"end_character":32},"in_reply_to":"df87a7cf_74dd5bde","updated":"2017-12-14 16:22:56.000000000","message":"Removed.","commit_id":"2a801815cf5d4ac278c687c492b708deacdfaa10"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"3ae69ca654e783a796735ecd4a270ae6cb2f8a54","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        node_states \u003d {}"},{"line_number":117,"context_line":"        try:"},{"line_number":118,"context_line":"            ironic_ports \u003d self.ironic_client.port.list(detail\u003dTrue)"},{"line_number":119,"context_line":"        except Exception:"},{"line_number":120,"context_line":"            LOG.exception(\"Failed to get ironic port data!\")"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"        for port in ironic_ports:"}],"source_content_type":"text/x-python","patch_set":12,"id":"df87a7cf_b49d230b","line":119,"updated":"2017-12-11 16:33:57.000000000","message":"Please don\u0027t use \u0027Exception\u0027. Figure out what exceptions can be raised and be more granular.","commit_id":"2a801815cf5d4ac278c687c492b708deacdfaa10"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"9f0f4bc903b19ba5e5785606d272ad228c50c696","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        node_states \u003d {}"},{"line_number":117,"context_line":"        try:"},{"line_number":118,"context_line":"            ironic_ports \u003d self.ironic_client.port.list(detail\u003dTrue)"},{"line_number":119,"context_line":"        except Exception:"},{"line_number":120,"context_line":"            LOG.exception(\"Failed to get ironic port data!\")"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"        for port in ironic_ports:"}],"source_content_type":"text/x-python","patch_set":12,"id":"df87a7cf_eadb644c","line":119,"in_reply_to":"df87a7cf_b49d230b","updated":"2017-12-14 16:22:56.000000000","message":"I catch the ones I belive warrants a stop of the looping call.","commit_id":"2a801815cf5d4ac278c687c492b708deacdfaa10"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"3ae69ca654e783a796735ecd4a270ae6cb2f8a54","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        for state in node_states.values():"},{"line_number":130,"context_line":"            try:"},{"line_number":131,"context_line":"                self.state_rpc.report_state(self.context, state)"},{"line_number":132,"context_line":"            except Exception:"},{"line_number":133,"context_line":"                LOG.exception(\"Failed reporting state!\")"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def run(self):"}],"source_content_type":"text/x-python","patch_set":12,"id":"df87a7cf_149baf17","line":132,"updated":"2017-12-11 16:33:57.000000000","message":"Please don\u0027t use \u0027Exception\u0027. Figure out what exceptions can be raised and be more granular.","commit_id":"2a801815cf5d4ac278c687c492b708deacdfaa10"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"9f0f4bc903b19ba5e5785606d272ad228c50c696","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        for state in node_states.values():"},{"line_number":130,"context_line":"            try:"},{"line_number":131,"context_line":"                self.state_rpc.report_state(self.context, state)"},{"line_number":132,"context_line":"            except Exception:"},{"line_number":133,"context_line":"                LOG.exception(\"Failed reporting state!\")"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"    def run(self):"}],"source_content_type":"text/x-python","patch_set":12,"id":"df87a7cf_2aa06ca5","line":132,"in_reply_to":"df87a7cf_149baf17","updated":"2017-12-14 16:22:56.000000000","message":"I catch the AttributeError, and stop the looping call if that is raised. Similar to what is done here:\nhttps://github.com/openstack/neutron/blob/master/neutron/agent/metadata/agent.py#L262:L273","commit_id":"2a801815cf5d4ac278c687c492b708deacdfaa10"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"c2c370093c9d5637a91d6ab0d217b0676bdf4153","unresolved":false,"context_lines":[{"line_number":129,"context_line":"                          \"will be disabled.\")"},{"line_number":130,"context_line":"            self.heartbeat.stop()"},{"line_number":131,"context_line":"            return False"},{"line_number":132,"context_line":"        except Exception:"},{"line_number":133,"context_line":"            LOG.exception(\"Failed to get ironic port data!\")"},{"line_number":134,"context_line":"            return False"},{"line_number":135,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"df87a7cf_0a4a487f","line":132,"updated":"2017-12-14 16:42:24.000000000","message":"I\u0027m still not a fan of this. I\u0027d like other people\u0027s opinions on it. \"Exception\" is just too big of a catch in my opinion.\n\nWhy do we feel this is necessary? What happens if we get rid of it?\n\nIf we do need it, then give a comment that justifies its existence.","commit_id":"6f4c87456bd00d555177176a67a476e387308fd0"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"5abb459b0ec4cb267058f744ce408f3ea0a87be0","unresolved":false,"context_lines":[{"line_number":129,"context_line":"                          \"will be disabled.\")"},{"line_number":130,"context_line":"            self.heartbeat.stop()"},{"line_number":131,"context_line":"            return False"},{"line_number":132,"context_line":"        except Exception:"},{"line_number":133,"context_line":"            LOG.exception(\"Failed to get ironic port data!\")"},{"line_number":134,"context_line":"            return False"},{"line_number":135,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"df87a7cf_8e5c1fee","line":132,"in_reply_to":"df87a7cf_0a4a487f","updated":"2017-12-15 01:54:18.000000000","message":"Same as below, we do not want to remove it as that would stop the loopingcall when an exception that we do not catch is raised.","commit_id":"6f4c87456bd00d555177176a67a476e387308fd0"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"c2c370093c9d5637a91d6ab0d217b0676bdf4153","unresolved":false,"context_lines":[{"line_number":161,"context_line":"                self.heartbeat.stop()"},{"line_number":162,"context_line":"                # Don\u0027t continue reporting the remaining agents in this case."},{"line_number":163,"context_line":"                return"},{"line_number":164,"context_line":"            except Exception:"},{"line_number":165,"context_line":"                LOG.exception(\"Failed reporting state!\")"},{"line_number":166,"context_line":"                # Don\u0027t continue reporting the remaining nodes if one failed."},{"line_number":167,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":13,"id":"df87a7cf_4a35b0f6","line":164,"updated":"2017-12-14 16:42:24.000000000","message":"I\u0027m still not a fan of this. I\u0027d like other people\u0027s opinions on it. \"Exception\" is just too big of a catch in my opinion.\n\nWhy do we feel this is necessary? What happens if we get rid of it?\n\nIf we do need it, then give a comment that justifies its existence.","commit_id":"6f4c87456bd00d555177176a67a476e387308fd0"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"5abb459b0ec4cb267058f744ce408f3ea0a87be0","unresolved":false,"context_lines":[{"line_number":161,"context_line":"                self.heartbeat.stop()"},{"line_number":162,"context_line":"                # Don\u0027t continue reporting the remaining agents in this case."},{"line_number":163,"context_line":"                return"},{"line_number":164,"context_line":"            except Exception:"},{"line_number":165,"context_line":"                LOG.exception(\"Failed reporting state!\")"},{"line_number":166,"context_line":"                # Don\u0027t continue reporting the remaining nodes if one failed."},{"line_number":167,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":13,"id":"df87a7cf_ced4674a","line":164,"in_reply_to":"df87a7cf_4a35b0f6","updated":"2017-12-15 01:54:18.000000000","message":"Comparing other agents, catching Exception is the typical implementation.\n\nhttps://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/drivers/mech_sriov/agent/sriov_nic_agent.py#L177:L186\n\nhttps://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py#L311:L327\n\nIf we where to remove it, the exception would be raised, and when the loopingcall gets an exception the looping call stops. In case the messaging server is down, or unreachable, due to some temporary issue. We don\u0027t want the looping call to stop. We want the agent to continue trying, as it will eventually succeed once the operator fixed the issue.","commit_id":"6f4c87456bd00d555177176a67a476e387308fd0"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"9abc92a9148f64c1c434a503c86f143d5d649a37","unresolved":false,"context_lines":[{"line_number":131,"context_line":"            return False"},{"line_number":132,"context_line":"        except Exception:"},{"line_number":133,"context_line":"            LOG.exception(\"Failed to get ironic port data!\")"},{"line_number":134,"context_line":"            return False"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"        return ironic_ports"},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"df87a7cf_ca7a09b9","line":134,"updated":"2017-12-15 12:31:00.000000000","message":"No need to return False from this function, if there is an exception, then this function will return [], and then in the function below you can just do:\n\nironic_ports \u003d self._get_ironic_ports()\nif not ironic_ports:\n  return\n\nan empty list is falsey in python.","commit_id":"3c97b26beeda14ea9a90f585196b82374bfda9da"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"31e05aebb7638bc339748e9c5aa978c37ad1f5da","unresolved":false,"context_lines":[{"line_number":131,"context_line":"            return False"},{"line_number":132,"context_line":"        except Exception:"},{"line_number":133,"context_line":"            LOG.exception(\"Failed to get ironic port data!\")"},{"line_number":134,"context_line":"            return False"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"        return ironic_ports"},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"df87a7cf_85a6d9c0","line":134,"in_reply_to":"df87a7cf_ca7a09b9","updated":"2017-12-19 19:49:44.000000000","message":"Done","commit_id":"3c97b26beeda14ea9a90f585196b82374bfda9da"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"9abc92a9148f64c1c434a503c86f143d5d649a37","unresolved":false,"context_lines":[{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    def _report_state(self):"},{"line_number":139,"context_line":"        node_states \u003d {}"},{"line_number":140,"context_line":"        ironic_ports \u003d self._get_ironic_ports()"},{"line_number":141,"context_line":"        try:"},{"line_number":142,"context_line":"            if not len(ironic_ports) \u003e 0:"},{"line_number":143,"context_line":"                return"},{"line_number":144,"context_line":"        except TypeError:"},{"line_number":145,"context_line":"            # If an exception was caught in _get_ironic_ports() ..."},{"line_number":146,"context_line":"            return"},{"line_number":147,"context_line":"        for port in ironic_ports:"},{"line_number":148,"context_line":"            node \u003d port.node_uuid"},{"line_number":149,"context_line":"            node_states.setdefault(node, self.get_template_node_state(node))"}],"source_content_type":"text/x-python","patch_set":15,"id":"df87a7cf_ea5eed43","line":146,"range":{"start_line":140,"start_character":0,"end_line":146,"end_character":18},"updated":"2017-12-15 12:31:00.000000000","message":"see comment above.","commit_id":"3c97b26beeda14ea9a90f585196b82374bfda9da"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"31e05aebb7638bc339748e9c5aa978c37ad1f5da","unresolved":false,"context_lines":[{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    def _report_state(self):"},{"line_number":139,"context_line":"        node_states \u003d {}"},{"line_number":140,"context_line":"        ironic_ports \u003d self._get_ironic_ports()"},{"line_number":141,"context_line":"        try:"},{"line_number":142,"context_line":"            if not len(ironic_ports) \u003e 0:"},{"line_number":143,"context_line":"                return"},{"line_number":144,"context_line":"        except TypeError:"},{"line_number":145,"context_line":"            # If an exception was caught in _get_ironic_ports() ..."},{"line_number":146,"context_line":"            return"},{"line_number":147,"context_line":"        for port in ironic_ports:"},{"line_number":148,"context_line":"            node \u003d port.node_uuid"},{"line_number":149,"context_line":"            node_states.setdefault(node, self.get_template_node_state(node))"}],"source_content_type":"text/x-python","patch_set":15,"id":"df87a7cf_25a7cdbe","line":146,"range":{"start_line":140,"start_character":0,"end_line":146,"end_character":18},"in_reply_to":"df87a7cf_ea5eed43","updated":"2017-12-19 19:49:44.000000000","message":"Done","commit_id":"3c97b26beeda14ea9a90f585196b82374bfda9da"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"9abc92a9148f64c1c434a503c86f143d5d649a37","unresolved":false,"context_lines":[{"line_number":148,"context_line":"            node \u003d port.node_uuid"},{"line_number":149,"context_line":"            node_states.setdefault(node, self.get_template_node_state(node))"},{"line_number":150,"context_line":"            mapping \u003d node_states[node][\"configurations\"][\"bridge_mappings\"]"},{"line_number":151,"context_line":"            mapping.setdefault(port.physical_network)"},{"line_number":152,"context_line":"            mapping[port.physical_network] \u003d port.uuid"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        for state in node_states.values():"},{"line_number":155,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":15,"id":"df87a7cf_aaf22599","line":152,"range":{"start_line":151,"start_character":12,"end_line":152,"end_character":54},"updated":"2017-12-15 12:31:00.000000000","message":"not sure this logic is correct, port.physical_network can be None, so I think we need:\n\nif port.physical_network:\n    mapping[port.physical_network] \u003d port.uuid\n\nAlso with baremetal multiple NICs can be on the same physnet so I think we\u0027re actually going to have to do something like:\n\nif port.physical_network:\n    mapping[port.physical_network] \u003d \"yes\"\n\nthis should be fine as neutron/nova only care about the complete list of physical networks a node has access to, not which ports map to which physnet. The mapping of which pif gets which vif happens on the ironic side.","commit_id":"3c97b26beeda14ea9a90f585196b82374bfda9da"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"31e05aebb7638bc339748e9c5aa978c37ad1f5da","unresolved":false,"context_lines":[{"line_number":148,"context_line":"            node \u003d port.node_uuid"},{"line_number":149,"context_line":"            node_states.setdefault(node, self.get_template_node_state(node))"},{"line_number":150,"context_line":"            mapping \u003d node_states[node][\"configurations\"][\"bridge_mappings\"]"},{"line_number":151,"context_line":"            mapping.setdefault(port.physical_network)"},{"line_number":152,"context_line":"            mapping[port.physical_network] \u003d port.uuid"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        for state in node_states.values():"},{"line_number":155,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":15,"id":"df87a7cf_c5c2a153","line":152,"range":{"start_line":151,"start_character":12,"end_line":152,"end_character":54},"in_reply_to":"df87a7cf_aaf22599","updated":"2017-12-19 19:49:44.000000000","message":"How about checking right at the beginning and continue to the next port if port.physical_network is None? Is there a reason to report state for nodes with an empty mapping?\n\n        for port in ironic_ports:\n            if port.physical_network is None:\n                continue\n            node \u003d port.node_uuid\n            node_states.setdefault(node, self.get_template_node_state(node))\n            mapping \u003d node_states[node][\"configurations\"][\"bridge_mappings\"]\n            mapping[port.physical_network] \u003d \"yes\"","commit_id":"3c97b26beeda14ea9a90f585196b82374bfda9da"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"46bd5bd85d00ff4d9f207a461bec25d1a9911230","unresolved":false,"context_lines":[{"line_number":148,"context_line":"            node \u003d port.node_uuid"},{"line_number":149,"context_line":"            node_states.setdefault(node, self.get_template_node_state(node))"},{"line_number":150,"context_line":"            mapping \u003d node_states[node][\"configurations\"][\"bridge_mappings\"]"},{"line_number":151,"context_line":"            mapping.setdefault(port.physical_network)"},{"line_number":152,"context_line":"            mapping[port.physical_network] \u003d port.uuid"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        for state in node_states.values():"},{"line_number":155,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":15,"id":"df87a7cf_ee8a1462","line":152,"range":{"start_line":151,"start_character":12,"end_line":152,"end_character":54},"in_reply_to":"df87a7cf_c5c2a153","updated":"2017-12-20 11:07:49.000000000","message":"+1 makes sense","commit_id":"3c97b26beeda14ea9a90f585196b82374bfda9da"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"9abc92a9148f64c1c434a503c86f143d5d649a37","unresolved":false,"context_lines":[{"line_number":166,"context_line":"                # Don\u0027t continue reporting the remaining nodes if one failed."},{"line_number":167,"context_line":"                return"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        return"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def run(self):"},{"line_number":172,"context_line":"        self.start_looping_calls()"}],"source_content_type":"text/x-python","patch_set":15,"id":"df87a7cf_2ab7f588","line":169,"updated":"2017-12-15 12:31:00.000000000","message":"No need to have a return here, return None is implict","commit_id":"3c97b26beeda14ea9a90f585196b82374bfda9da"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"31e05aebb7638bc339748e9c5aa978c37ad1f5da","unresolved":false,"context_lines":[{"line_number":166,"context_line":"                # Don\u0027t continue reporting the remaining nodes if one failed."},{"line_number":167,"context_line":"                return"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        return"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def run(self):"},{"line_number":172,"context_line":"        self.start_looping_calls()"}],"source_content_type":"text/x-python","patch_set":15,"id":"df87a7cf_45ac519e","line":169,"in_reply_to":"df87a7cf_2ab7f588","updated":"2017-12-19 19:49:44.000000000","message":"Done","commit_id":"3c97b26beeda14ea9a90f585196b82374bfda9da"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"f03ced602f4d6c6aad3a87e6475987a825a0bd1a","unresolved":false,"context_lines":[{"line_number":138,"context_line":"        if not ironic_ports:"},{"line_number":139,"context_line":"            return"},{"line_number":140,"context_line":"        for port in ironic_ports:"},{"line_number":141,"context_line":"            if port.physical_network is None:"},{"line_number":142,"context_line":"                continue"},{"line_number":143,"context_line":"            node \u003d port.node_uuid"},{"line_number":144,"context_line":"            node_states.setdefault(node, self.get_template_node_state(node))"},{"line_number":145,"context_line":"            mapping \u003d node_states[node][\"configurations\"][\"bridge_mappings\"]"}],"source_content_type":"text/x-python","patch_set":25,"id":"7f96bb07_4e4fd1bc","line":142,"range":{"start_line":141,"start_character":12,"end_line":142,"end_character":24},"updated":"2018-01-24 07:58:13.000000000","message":"Based on feedback in change I7841d59c3590106dd8ac7e625a9db7b47674fe29 we need to remove this.\n\nIf we want the default for flat networks to be binding using task.node.uuid we need to have agents registered for all ironic nodes, even those with no physical_network info.\n\nIf we don\u0027t neutron will refuse to bind the port with \"no agent of type Baremetal Node registered on host\".","commit_id":"0de90146b527e22bddd051dd3d02e10368ce176f"}],"networking_baremetal/i18n.py":[{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"09e7bc222f83c6761e216c68d3626c6f5b07e532","unresolved":false,"context_lines":[{"line_number":30,"context_line":"# requires oslo.i18n \u003e\u003d2.1.0"},{"line_number":31,"context_line":"_P \u003d _translators.plural_form"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"# Translators for log levels."},{"line_number":34,"context_line":"#"},{"line_number":35,"context_line":"# The abbreviated names are meant to reflect the usual use of a short"},{"line_number":36,"context_line":"# name like \u0027_\u0027. The \"L\" is for \"log\" and the other letter comes from"},{"line_number":37,"context_line":"# the level."},{"line_number":38,"context_line":"_LI \u003d _translators.log_info"},{"line_number":39,"context_line":"_LW \u003d _translators.log_warning"},{"line_number":40,"context_line":"_LE \u003d _translators.log_error"},{"line_number":41,"context_line":"_LC \u003d _translators.log_critical"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"def get_available_languages():"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff0f0b1f_f6344bfd","line":41,"range":{"start_line":33,"start_character":0,"end_line":41,"end_character":31},"updated":"2017-05-22 07:45:41.000000000","message":"Do we really need these? AFAIR there was a more or less general agreement to stop translating log messages","commit_id":"d37a451db2523efd2a15c4d44d93da4a177d938b"}],"networking_baremetal/ironic_agent/main.py":[{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"09e7bc222f83c6761e216c68d3626c6f5b07e532","unresolved":false,"context_lines":[{"line_number":41,"context_line":"    session \u003d loading.load_session_from_conf_options("},{"line_number":42,"context_line":"        CONF, group, auth\u003dauth)"},{"line_number":43,"context_line":"    return session"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"def get_client(token\u003dNone,"},{"line_number":47,"context_line":"               api_version\u003dDEFAULT_IRONIC_API_VERSION):  # pragma: no cover"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff0f0b1f_69ccdc60","line":44,"updated":"2017-05-22 07:45:41.000000000","message":"also for unit testing (which are currently absent :) ) an extra _reset_session function might be handy","commit_id":"d37a451db2523efd2a15c4d44d93da4a177d938b"},{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"09e7bc222f83c6761e216c68d3626c6f5b07e532","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"def get_client(token\u003dNone,"},{"line_number":47,"context_line":"               api_version\u003dDEFAULT_IRONIC_API_VERSION):  # pragma: no cover"},{"line_number":48,"context_line":"    \"\"\"Get Ironic client instance.\"\"\""},{"line_number":49,"context_line":"    # NOTE: To support standalone ironic without keystone"},{"line_number":50,"context_line":"    if CONF.ironic.auth_strategy \u003d\u003d \u0027noauth\u0027:"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff0f0b1f_09de8010","line":47,"range":{"start_line":47,"start_character":56,"end_line":47,"end_character":75},"updated":"2017-05-22 07:45:41.000000000","message":"nit - this does not seem to be needed, pep8 passes without it just fine. (also no need to split the line, it fits 79 chars alright)","commit_id":"d37a451db2523efd2a15c4d44d93da4a177d938b"},{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"09e7bc222f83c6761e216c68d3626c6f5b07e532","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        if token is None:"},{"line_number":58,"context_line":"            args \u003d {\u0027session\u0027: IRONIC_SESSION,"},{"line_number":59,"context_line":"                    \u0027region_name\u0027: CONF.ironic.os_region}"},{"line_number":60,"context_line":"        else:"},{"line_number":61,"context_line":"            ironic_url \u003d IRONIC_SESSION.get_endpoint("},{"line_number":62,"context_line":"                service_type\u003dCONF.ironic.os_service_type,"},{"line_number":63,"context_line":"                endpoint_type\u003dCONF.ironic.os_endpoint_type,"},{"line_number":64,"context_line":"                region_name\u003dCONF.ironic.os_region"},{"line_number":65,"context_line":"            )"},{"line_number":66,"context_line":"            args \u003d {\u0027token\u0027: token,"},{"line_number":67,"context_line":"                    \u0027endpoint\u0027: ironic_url}"},{"line_number":68,"context_line":"    args[\u0027os_ironic_api_version\u0027] \u003d api_version"},{"line_number":69,"context_line":"    args[\u0027max_retries\u0027] \u003d CONF.ironic.max_retries"},{"line_number":70,"context_line":"    args[\u0027retry_interval\u0027] \u003d CONF.ironic.retry_interval"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff0f0b1f_094e806e","line":67,"range":{"start_line":60,"start_character":0,"end_line":67,"end_character":43},"updated":"2017-05-22 07:45:41.000000000","message":"I think this is a bit premature. As this will be an agent running on its own, it seems at no point would it need to call ironic API with a token from incoming request, so token here will always be None (and in fact you are instantiating the client exactly in this way, and this code path is currently never used).\n\nwe could add this later if needed (probably also moving this logic to a separate module as I presume more parts of networking-baremetal would eventually need access to ironic api).","commit_id":"d37a451db2523efd2a15c4d44d93da4a177d938b"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"ad4e55ad3d4a8d984474530033aced5bd1435209","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        mapping \u003d {}"},{"line_number":108,"context_line":"        ports \u003d self.ironic_client.port.list(node_uuid)"},{"line_number":109,"context_line":"        for port in ports:"},{"line_number":110,"context_line":"            mapping[port.uuid] \u003d port.physnet"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def _report_state(self):"},{"line_number":113,"context_line":"        for uuid, state in self.node_states.items():"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff0f0b1f_27eccbf1","line":110,"updated":"2017-05-22 09:17:14.000000000","message":"Subject to physnet review:\n\ns/physnet/physical_network/","commit_id":"d37a451db2523efd2a15c4d44d93da4a177d938b"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"ad4e55ad3d4a8d984474530033aced5bd1435209","unresolved":false,"context_lines":[{"line_number":120,"context_line":"                # This means the server does not support report_state"},{"line_number":121,"context_line":"                LOG.warning(_LW(\u0027Neutron server does not support state report.\u0027"},{"line_number":122,"context_line":"                                \u0027 State reporting will be disabled.\u0027))"},{"line_number":123,"context_line":"                self.heartbeat.stop()"},{"line_number":124,"context_line":"                return"},{"line_number":125,"context_line":"            except Exception:"},{"line_number":126,"context_line":"                LOG.exception(_LE(\"Failed reporting state!\"))"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff0f0b1f_e792534b","line":123,"updated":"2017-05-22 09:17:14.000000000","message":"Why might the server not support this? Is it an optional feature or one that is dependent upon a specific version of neutron? If it\u0027s the latter, does there need to be a retry mechanism to ensure that this will work across upgrades if there is no guarantee that the neutron server will be updated before this agent?","commit_id":"d37a451db2523efd2a15c4d44d93da4a177d938b"},{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"09e7bc222f83c6761e216c68d3626c6f5b07e532","unresolved":false,"context_lines":[{"line_number":128,"context_line":"            state.pop(\u0027start_flag\u0027, None)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def _baremetal_sync(self):"},{"line_number":131,"context_line":"        nodes \u003d self.ironic_client.node.list()"},{"line_number":132,"context_line":"        current_uuids \u003d set([node.uuid for node in nodes])"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        known_uuids \u003d set(self.node_states.keys())"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff0f0b1f_c9abe886","line":131,"range":{"start_line":131,"start_character":43,"end_line":131,"end_character":46},"updated":"2017-05-22 07:45:41.000000000","message":"so in this approach it is not possible to actually change the node\u0027s phys net assignment (e.g. when racks are re-wired/switches reconfigured etc) except for deleting the node from ironic and creating it back again.\n\nI understand that running a comparison of port.physnet for every existing node+ports might get costly due to the number of API requests performed, so how about we filter out nodes in maintenance from the list of nodes in this call? Those won\u0027t be considered for scheduling later on any way, and this will allow to \"re-create\" the node in neutron\u0027s view w/o actually deleting it from ironic.","commit_id":"d37a451db2523efd2a15c4d44d93da4a177d938b"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"ad4e55ad3d4a8d984474530033aced5bd1435209","unresolved":false,"context_lines":[{"line_number":128,"context_line":"            state.pop(\u0027start_flag\u0027, None)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def _baremetal_sync(self):"},{"line_number":131,"context_line":"        nodes \u003d self.ironic_client.node.list()"},{"line_number":132,"context_line":"        current_uuids \u003d set([node.uuid for node in nodes])"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        known_uuids \u003d set(self.node_states.keys())"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff0f0b1f_878957cb","line":131,"range":{"start_line":131,"start_character":43,"end_line":131,"end_character":46},"in_reply_to":"ff0f0b1f_c9abe886","updated":"2017-05-22 09:17:14.000000000","message":"That\u0027s a good point. This also has the opportunity to race with the asynchronous creation of ports and nodes - it\u0027s the nodes\u0027 ports we\u0027re really interested in.\n\nIf anything, shouldn\u0027t this be doing a port list? We could request only the port uuid, node uuid and port physnet. That would be more efficient than doing a node list followed by a port list per-node. It would prevent us from filtering out nodes by maintenance mode or state though.\n\nIf you want to restrict the returned items to those that have changed, how about adding sort_by\u003dupdated_at with a limit? You\u0027d need some fiddly logic to make sure you catch all updates since the last time you looked and may need to make multiple calls if your limit is too small. This may be a good v1.1 feature...\n\nAlternatively, could this be wired into the ironic notification system to catch port updates?","commit_id":"d37a451db2523efd2a15c4d44d93da4a177d938b"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"ad4e55ad3d4a8d984474530033aced5bd1435209","unresolved":false,"context_lines":[{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def _baremetal_sync(self):"},{"line_number":131,"context_line":"        nodes \u003d self.ironic_client.node.list()"},{"line_number":132,"context_line":"        current_uuids \u003d set([node.uuid for node in nodes])"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        known_uuids \u003d set(self.node_states.keys())"},{"line_number":135,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ff0f0b1f_678403b2","line":132,"updated":"2017-05-22 09:17:14.000000000","message":"Perhaps a dict mapping port uuid to a (node uuid, physnet) tuple would be a suitable cache?","commit_id":"d37a451db2523efd2a15c4d44d93da4a177d938b"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"91f8de1fda3b8057a770e535bb84749b58bf821e","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        self.ironic_client \u003d get_client()"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def start_looping_calls(self):"},{"line_number":70,"context_line":"        self.heartbeat \u003d loopingcall.FixedIntervalLoopingCall("},{"line_number":71,"context_line":"            self._report_state)"},{"line_number":72,"context_line":"        self.heartbeat.start(interval\u003d60)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def get_empty_node_state(self, node_uuid):"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_fd390d41","line":71,"range":{"start_line":70,"start_character":8,"end_line":71,"end_character":31},"updated":"2017-05-30 16:52:13.000000000","message":"separate _get_state out of _report_state?","commit_id":"cde7f3ad4c240aa2c0e51860ec4d0e2f32ab3238"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"91f8de1fda3b8057a770e535bb84749b58bf821e","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            \u0027agent_type\u0027: \u0027baremetal-node\u0027}"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def _report_state(self):"},{"line_number":85,"context_line":"        ironic_ports \u003d self.ironic_client.port.list(detail\u003dTrue)"},{"line_number":86,"context_line":"        node_states \u003d {}"},{"line_number":87,"context_line":"        for port in ironic_ports:"},{"line_number":88,"context_line":"            node \u003d port.node_uuid"},{"line_number":89,"context_line":"            if node not in node_states:"},{"line_number":90,"context_line":"                node_states[node] \u003d self.get_empty_node_state(node)"},{"line_number":91,"context_line":"            mapping \u003d node_states[node][\"configurations\"][\"bridge_mappings\"]"},{"line_number":92,"context_line":"            mapping[port.uuid] \u003d port.physical_network"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        for uuid, state in self.node_states.items():"},{"line_number":95,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":4,"id":"df140735_ddd089fa","line":92,"range":{"start_line":85,"start_character":8,"end_line":92,"end_character":54},"updated":"2017-05-30 16:52:13.000000000","message":"Move this bit to a _get_state function?","commit_id":"cde7f3ad4c240aa2c0e51860ec4d0e2f32ab3238"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"60dc0d92dc4a9354c250835f0dad9f901f4904d7","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from oslo_log import log as logging"},{"line_number":18,"context_line":"from oslo_service import loopingcall"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from neutron_lib import context"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from keystoneauth1 import loading"},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"5f4e5783_858efecd","line":20,"updated":"2017-10-12 17:05:45.000000000","message":"Shouldn\u0027t lines 16-28 all be in one section together? Aren\u0027t they all 3rd party libraries as far as this package is concerned.","commit_id":"abd0568e872b920be21923a625e43919786fa5a5"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"6e2a97f6efed64de5a644edf07cce066cbb93248","unresolved":false,"context_lines":[{"line_number":17,"context_line":"from oslo_log import log as logging"},{"line_number":18,"context_line":"from oslo_service import loopingcall"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from neutron_lib import context"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from keystoneauth1 import loading"},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"ff82abbf_9666bc51","line":20,"in_reply_to":"5f4e5783_858efecd","updated":"2017-11-20 07:57:21.000000000","message":"Done","commit_id":"abd0568e872b920be21923a625e43919786fa5a5"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"60dc0d92dc4a9354c250835f0dad9f901f4904d7","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"class BaremetalNeutronAgent(object):"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    def __init__(self, conf):"},{"line_number":67,"context_line":"        self.context \u003d context.get_admin_context_without_session()"},{"line_number":68,"context_line":"        self.state_rpc \u003d agent_rpc.PluginReportStateAPI(topics.REPORTS)"},{"line_number":69,"context_line":"        self.ironic_client \u003d get_client()"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f4e5783_0571eee0","line":66,"range":{"start_line":66,"start_character":23,"end_line":66,"end_character":27},"updated":"2017-10-12 17:05:45.000000000","message":"This isn\u0027t used. Is that intentional, like is this a standard API?  If so, can a comment be added that it is not used on purpose. Or delete it if not needed.","commit_id":"abd0568e872b920be21923a625e43919786fa5a5"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"6e2a97f6efed64de5a644edf07cce066cbb93248","unresolved":false,"context_lines":[{"line_number":63,"context_line":""},{"line_number":64,"context_line":"class BaremetalNeutronAgent(object):"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    def __init__(self, conf):"},{"line_number":67,"context_line":"        self.context \u003d context.get_admin_context_without_session()"},{"line_number":68,"context_line":"        self.state_rpc \u003d agent_rpc.PluginReportStateAPI(topics.REPORTS)"},{"line_number":69,"context_line":"        self.ironic_client \u003d get_client()"}],"source_content_type":"text/x-python","patch_set":7,"id":"ff82abbf_916486bb","line":66,"range":{"start_line":66,"start_character":23,"end_line":66,"end_character":27},"in_reply_to":"5f4e5783_0571eee0","updated":"2017-11-20 07:57:21.000000000","message":"I change this to \u0027def __init__(self, conf\u003dNone):\u0027, but I think we might just remove it?","commit_id":"abd0568e872b920be21923a625e43919786fa5a5"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"60dc0d92dc4a9354c250835f0dad9f901f4904d7","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        node_states \u003d {}"},{"line_number":90,"context_line":"        for port in ironic_ports:"},{"line_number":91,"context_line":"            node \u003d port.node_uuid"},{"line_number":92,"context_line":"            if node not in node_states:"},{"line_number":93,"context_line":"                node_states[node] \u003d self.get_template_node_state(node)"},{"line_number":94,"context_line":"            mapping \u003d node_states[node][\"configurations\"][\"bridge_mappings\"]"},{"line_number":95,"context_line":"            if port.physical_network not in mapping:"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f4e5783_4535a6f6","line":92,"updated":"2017-10-12 17:05:45.000000000","message":"Can do this:\n\n node_states.setdefault(node, self.get_template_node_state(node))","commit_id":"abd0568e872b920be21923a625e43919786fa5a5"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"377968ffe0676fd378c88cae3d02fac670d780d5","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        node_states \u003d {}"},{"line_number":90,"context_line":"        for port in ironic_ports:"},{"line_number":91,"context_line":"            node \u003d port.node_uuid"},{"line_number":92,"context_line":"            if node not in node_states:"},{"line_number":93,"context_line":"                node_states[node] \u003d self.get_template_node_state(node)"},{"line_number":94,"context_line":"            mapping \u003d node_states[node][\"configurations\"][\"bridge_mappings\"]"},{"line_number":95,"context_line":"            if port.physical_network not in mapping:"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f4e5783_dfd21e28","line":92,"range":{"start_line":92,"start_character":12,"end_line":92,"end_character":39},"updated":"2017-10-17 09:44:40.000000000","message":"wont this always be the case since node states is set {} in line 89?\nWould we not want to keep node states, and update only if the port.physical_netowork associated with a port is changes?","commit_id":"abd0568e872b920be21923a625e43919786fa5a5"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"6e2a97f6efed64de5a644edf07cce066cbb93248","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        node_states \u003d {}"},{"line_number":90,"context_line":"        for port in ironic_ports:"},{"line_number":91,"context_line":"            node \u003d port.node_uuid"},{"line_number":92,"context_line":"            if node not in node_states:"},{"line_number":93,"context_line":"                node_states[node] \u003d self.get_template_node_state(node)"},{"line_number":94,"context_line":"            mapping \u003d node_states[node][\"configurations\"][\"bridge_mappings\"]"},{"line_number":95,"context_line":"            if port.physical_network not in mapping:"}],"source_content_type":"text/x-python","patch_set":7,"id":"ff82abbf_3159fafd","line":92,"in_reply_to":"5f4e5783_4535a6f6","updated":"2017-11-20 07:57:21.000000000","message":"Done","commit_id":"abd0568e872b920be21923a625e43919786fa5a5"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"6e2a97f6efed64de5a644edf07cce066cbb93248","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        node_states \u003d {}"},{"line_number":90,"context_line":"        for port in ironic_ports:"},{"line_number":91,"context_line":"            node \u003d port.node_uuid"},{"line_number":92,"context_line":"            if node not in node_states:"},{"line_number":93,"context_line":"                node_states[node] \u003d self.get_template_node_state(node)"},{"line_number":94,"context_line":"            mapping \u003d node_states[node][\"configurations\"][\"bridge_mappings\"]"},{"line_number":95,"context_line":"            if port.physical_network not in mapping:"}],"source_content_type":"text/x-python","patch_set":7,"id":"ff82abbf_31833a07","line":92,"range":{"start_line":92,"start_character":12,"end_line":92,"end_character":39},"in_reply_to":"5f4e5783_dfd21e28","updated":"2017-11-20 07:57:21.000000000","message":"I realized that each ironic node registers as an agent in neutron with this approach. So I guess regular updates to all makes sense to keep neutron reporting the agents alive.","commit_id":"abd0568e872b920be21923a625e43919786fa5a5"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"60dc0d92dc4a9354c250835f0dad9f901f4904d7","unresolved":false,"context_lines":[{"line_number":92,"context_line":"            if node not in node_states:"},{"line_number":93,"context_line":"                node_states[node] \u003d self.get_template_node_state(node)"},{"line_number":94,"context_line":"            mapping \u003d node_states[node][\"configurations\"][\"bridge_mappings\"]"},{"line_number":95,"context_line":"            if port.physical_network not in mapping:"},{"line_number":96,"context_line":"                mapping[port.physical_network] \u003d []"},{"line_number":97,"context_line":"            mapping[port.physical_network] \u003d port.uuid"},{"line_number":98,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"5f4e5783_85039e0f","line":95,"updated":"2017-10-12 17:05:45.000000000","message":"Can do this:\n\n mapping.setdefault(port.physical_network, [])\n\nBut line 97 confuses me.","commit_id":"abd0568e872b920be21923a625e43919786fa5a5"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"6e2a97f6efed64de5a644edf07cce066cbb93248","unresolved":false,"context_lines":[{"line_number":92,"context_line":"            if node not in node_states:"},{"line_number":93,"context_line":"                node_states[node] \u003d self.get_template_node_state(node)"},{"line_number":94,"context_line":"            mapping \u003d node_states[node][\"configurations\"][\"bridge_mappings\"]"},{"line_number":95,"context_line":"            if port.physical_network not in mapping:"},{"line_number":96,"context_line":"                mapping[port.physical_network] \u003d []"},{"line_number":97,"context_line":"            mapping[port.physical_network] \u003d port.uuid"},{"line_number":98,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"ff82abbf_f172b27c","line":95,"in_reply_to":"5f4e5783_85039e0f","updated":"2017-11-20 07:57:21.000000000","message":"Done","commit_id":"abd0568e872b920be21923a625e43919786fa5a5"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"60dc0d92dc4a9354c250835f0dad9f901f4904d7","unresolved":false,"context_lines":[{"line_number":94,"context_line":"            mapping \u003d node_states[node][\"configurations\"][\"bridge_mappings\"]"},{"line_number":95,"context_line":"            if port.physical_network not in mapping:"},{"line_number":96,"context_line":"                mapping[port.physical_network] \u003d []"},{"line_number":97,"context_line":"            mapping[port.physical_network] \u003d port.uuid"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        for uuid, state in self.node_states.items():"},{"line_number":100,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f4e5783_c00e2431","line":97,"updated":"2017-10-12 17:05:45.000000000","message":"So on line 96, make it a list []. But then assign port.uuid as the value. Is it supposed to be a list or a value?","commit_id":"abd0568e872b920be21923a625e43919786fa5a5"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"6e2a97f6efed64de5a644edf07cce066cbb93248","unresolved":false,"context_lines":[{"line_number":94,"context_line":"            mapping \u003d node_states[node][\"configurations\"][\"bridge_mappings\"]"},{"line_number":95,"context_line":"            if port.physical_network not in mapping:"},{"line_number":96,"context_line":"                mapping[port.physical_network] \u003d []"},{"line_number":97,"context_line":"            mapping[port.physical_network] \u003d port.uuid"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        for uuid, state in self.node_states.items():"},{"line_number":100,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":7,"id":"ff82abbf_71d22237","line":97,"in_reply_to":"5f4e5783_c00e2431","updated":"2017-11-20 07:57:21.000000000","message":"I changed to \u0027mapping.setdefault(port.physical_network)\u0027 which should set \u0027None\u0027 by default.","commit_id":"abd0568e872b920be21923a625e43919786fa5a5"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"60dc0d92dc4a9354c250835f0dad9f901f4904d7","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                mapping[port.physical_network] \u003d []"},{"line_number":97,"context_line":"            mapping[port.physical_network] \u003d port.uuid"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        for uuid, state in self.node_states.items():"},{"line_number":100,"context_line":"            try:"},{"line_number":101,"context_line":"                self.state_rpc.report_state(self.context, state)"},{"line_number":102,"context_line":"            except Exception:"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f4e5783_2023b8aa","line":99,"updated":"2017-10-12 17:05:45.000000000","message":"Since not using \u0027uuid\u0027.\n\n for state in self.node_states.values():","commit_id":"abd0568e872b920be21923a625e43919786fa5a5"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"6e2a97f6efed64de5a644edf07cce066cbb93248","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                mapping[port.physical_network] \u003d []"},{"line_number":97,"context_line":"            mapping[port.physical_network] \u003d port.uuid"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        for uuid, state in self.node_states.items():"},{"line_number":100,"context_line":"            try:"},{"line_number":101,"context_line":"                self.state_rpc.report_state(self.context, state)"},{"line_number":102,"context_line":"            except Exception:"}],"source_content_type":"text/x-python","patch_set":7,"id":"ff82abbf_91d7a624","line":99,"in_reply_to":"5f4e5783_2023b8aa","updated":"2017-11-20 07:57:21.000000000","message":"Done","commit_id":"abd0568e872b920be21923a625e43919786fa5a5"}],"networking_baremetal/plugins/ml2/baremetal_mech.py":[{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"377968ffe0676fd378c88cae3d02fac670d780d5","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"5f4e5783_c9c38c88","updated":"2017-10-17 09:44:40.000000000","message":"Would it not make sense to seperate driver code and agent code to different commits?","commit_id":"abd0568e872b920be21923a625e43919786fa5a5"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"377968ffe0676fd378c88cae3d02fac670d780d5","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        \"\"\""},{"line_number":54,"context_line":"        return agent[\u0027configurations\u0027].get(\u0027bridge_mappings\u0027, {})"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    def create_network_precommit(self, context):"},{"line_number":57,"context_line":"        \"\"\"Allocate resources for a new network."},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        Create a new network, allocating resources as necessary in the"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f4e5783_c93eecb6","line":56,"range":{"start_line":56,"start_character":8,"end_line":56,"end_character":32},"updated":"2017-10-17 09:44:40.000000000","message":"With the switch to SimpleAgentMechanismDriverBase can we remove these pre/post commits?","commit_id":"abd0568e872b920be21923a625e43919786fa5a5"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"377968ffe0676fd378c88cae3d02fac670d780d5","unresolved":false,"context_lines":[{"line_number":336,"context_line":"        call context.set_binding() with appropriate values and then"},{"line_number":337,"context_line":"        return True. Otherwise, it must return False."},{"line_number":338,"context_line":"        \"\"\""},{"line_number":339,"context_line":"        if self.check_segment_for_agent(segment, agent):"},{"line_number":340,"context_line":"            port \u003d context.current"},{"line_number":341,"context_line":"            provisioning_blocks.add_provisioning_component("},{"line_number":342,"context_line":"                context._plugin_context, port[\u0027id\u0027], resources.PORT,"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f4e5783_06163356","line":339,"range":{"start_line":339,"start_character":16,"end_line":339,"end_character":39},"updated":"2017-10-17 09:44:40.000000000","message":"Should we implement this here, or is it fine to use the boiler plate that we import? The class docstring states we need to implement it, but afaict the boiler plate code will work in this case.","commit_id":"abd0568e872b920be21923a625e43919786fa5a5"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"60dc0d92dc4a9354c250835f0dad9f901f4904d7","unresolved":false,"context_lines":[{"line_number":345,"context_line":"                                self.get_vif_type(context, agent, segment),"},{"line_number":346,"context_line":"                                self.get_vif_details(context, agent, segment))"},{"line_number":347,"context_line":"            return True"},{"line_number":348,"context_line":"        else:"},{"line_number":349,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f4e5783_a03688e5","line":348,"updated":"2017-10-12 17:05:45.000000000","message":"else is not needed.","commit_id":"abd0568e872b920be21923a625e43919786fa5a5"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"377968ffe0676fd378c88cae3d02fac670d780d5","unresolved":false,"context_lines":[{"line_number":345,"context_line":"                                self.get_vif_type(context, agent, segment),"},{"line_number":346,"context_line":"                                self.get_vif_details(context, agent, segment))"},{"line_number":347,"context_line":"            return True"},{"line_number":348,"context_line":"        else:"},{"line_number":349,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f4e5783_29a46007","line":348,"in_reply_to":"5f4e5783_a03688e5","updated":"2017-10-17 09:44:40.000000000","message":"+1","commit_id":"abd0568e872b920be21923a625e43919786fa5a5"}],"networking_baremetal/tests/unit/ironic_agent/test_ironic_agent.py":[{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"3ae69ca654e783a796735ecd4a270ae6cb2f8a54","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from neutron_lib import constants as n_const"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from networking_baremetal.agent import ironic_neutron_agent"},{"line_number":21,"context_line":"from networking_baremetal import constants as constants"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"class FakePort1(object):"}],"source_content_type":"text/x-python","patch_set":12,"id":"df87a7cf_54a5b745","line":21,"range":{"start_line":21,"start_character":43,"end_line":21,"end_character":55},"updated":"2017-12-11 16:33:57.000000000","message":"looks redundant","commit_id":"2a801815cf5d4ac278c687c492b708deacdfaa10"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"9f0f4bc903b19ba5e5785606d272ad228c50c696","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from neutron_lib import constants as n_const"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from networking_baremetal.agent import ironic_neutron_agent"},{"line_number":21,"context_line":"from networking_baremetal import constants as constants"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"class FakePort1(object):"}],"source_content_type":"text/x-python","patch_set":12,"id":"df87a7cf_060da1e6","line":21,"range":{"start_line":21,"start_character":43,"end_line":21,"end_character":55},"in_reply_to":"df87a7cf_54a5b745","updated":"2017-12-14 16:22:56.000000000","message":"Done","commit_id":"2a801815cf5d4ac278c687c492b708deacdfaa10"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"c2c370093c9d5637a91d6ab0d217b0676bdf4153","unresolved":false,"context_lines":[{"line_number":11,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":12,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"import mock"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import ironicclient.common.apiclient.exceptions as ironic_exc"}],"source_content_type":"text/x-python","patch_set":13,"id":"df87a7cf_2d75e698","line":14,"updated":"2017-12-14 16:42:24.000000000","message":"In case I missed any, please remove all the back-slashes used for line-continuation. We shouldn\u0027t need them. Just use parentheses ().","commit_id":"6f4c87456bd00d555177176a67a476e387308fd0"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"5abb459b0ec4cb267058f744ce408f3ea0a87be0","unresolved":false,"context_lines":[{"line_number":11,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":12,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"import mock"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import ironicclient.common.apiclient.exceptions as ironic_exc"}],"source_content_type":"text/x-python","patch_set":13,"id":"df87a7cf_33030045","line":14,"in_reply_to":"df87a7cf_2d75e698","updated":"2017-12-15 01:54:18.000000000","message":"Backslashes may still be appropriate at times. For example, long, multiple with-statements cannot use implicit continuation, so backslashes are acceptable:\n\nwith open(\u0027/path/to/some/file/you/want/to/read\u0027) as file_1, \\\n     open(\u0027/path/to/some/file/being/written\u0027, \u0027w\u0027) as file_2:\n    file_2.write(file_1.read())\n\n Ref: https://www.python.org/dev/peps/pep-0008/#maximum-line-length\n\nThe alternative is not much better ...\n\nWith backslash:\n\n       with mock.patch.object(ironic_neutron_agent.LOG,\n                               \u0027exception\u0027) as mock_log,\\\n                mock.patch.object(self.agent.ironic_client.port, \u0027list\u0027,\n                                  return_value\u003d[FakePort1(), FakePort2()]),\\\n                mock.patch.object(self.agent,\n                                  \u0027state_rpc\u0027) as mock_report_state:\n\nWith parentheses:\n\n        with mock.patch.object(ironic_neutron_agent.LOG, \u0027exception\u0027) as (\n                mock_log), mock.patch.object(self.agent.ironic_client.port,\n                                             \u0027list\u0027, return_value\u003d[\n                FakePort1(), FakePort2()]), mock.patch.object(self.agent,\n                                                              \u0027state_rpc\u0027) as (\n                mock_report_state):\n\n\nPersonally I find the backslash approach where each mock patch is starting on a new line better than the one using parantheses.","commit_id":"6f4c87456bd00d555177176a67a476e387308fd0"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"185450fd88cde2aca3f9300f96fb1293673caeef","unresolved":false,"context_lines":[{"line_number":11,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":12,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"import mock"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import ironicclient.common.apiclient.exceptions as ironic_exc"}],"source_content_type":"text/x-python","patch_set":13,"id":"df87a7cf_8e373f4e","line":14,"in_reply_to":"df87a7cf_33030045","updated":"2017-12-15 01:59:56.000000000","message":"Usually we use @mock.patch.object() decorators\n\nIs that not possible?","commit_id":"6f4c87456bd00d555177176a67a476e387308fd0"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"f7f36d74a0fc199d7651b588afc52d7d9efcb9db","unresolved":false,"context_lines":[{"line_number":11,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":12,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"import mock"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import ironicclient.common.apiclient.exceptions as ironic_exc"}],"source_content_type":"text/x-python","patch_set":13,"id":"df87a7cf_25e1712b","line":14,"in_reply_to":"df87a7cf_8e373f4e","updated":"2017-12-15 03:49:14.000000000","message":"For the most part. I need with for the report_state tests. But I can move the client and log to decorators.\n\nI\u0027ll push a new version.","commit_id":"6f4c87456bd00d555177176a67a476e387308fd0"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"c2c370093c9d5637a91d6ab0d217b0676bdf4153","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"import mock"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import ironicclient.common.apiclient.exceptions as ironic_exc"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from neutron.tests import base"}],"source_content_type":"text/x-python","patch_set":13,"id":"df87a7cf_6a067423","line":16,"updated":"2017-12-14 16:42:24.000000000","message":"\u0027mock\u0027 is considered a 3rd party import. So don\u0027t need blank line on line 16. Merge it together with the other 3rd party imports.","commit_id":"6f4c87456bd00d555177176a67a476e387308fd0"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"5abb459b0ec4cb267058f744ce408f3ea0a87be0","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"import mock"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import ironicclient.common.apiclient.exceptions as ironic_exc"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from neutron.tests import base"}],"source_content_type":"text/x-python","patch_set":13,"id":"df87a7cf_68e9937e","line":16,"in_reply_to":"df87a7cf_6a067423","updated":"2017-12-15 01:54:18.000000000","message":"Done","commit_id":"6f4c87456bd00d555177176a67a476e387308fd0"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"c2c370093c9d5637a91d6ab0d217b0676bdf4153","unresolved":false,"context_lines":[{"line_number":15,"context_line":"import mock"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import ironicclient.common.apiclient.exceptions as ironic_exc"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from neutron.tests import base"},{"line_number":20,"context_line":"from neutron_lib import constants as n_const"},{"line_number":21,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"df87a7cf_0a18087f","line":18,"updated":"2017-12-14 16:42:24.000000000","message":"Don\u0027t need this blank line","commit_id":"6f4c87456bd00d555177176a67a476e387308fd0"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"5abb459b0ec4cb267058f744ce408f3ea0a87be0","unresolved":false,"context_lines":[{"line_number":15,"context_line":"import mock"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import ironicclient.common.apiclient.exceptions as ironic_exc"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from neutron.tests import base"},{"line_number":20,"context_line":"from neutron_lib import constants as n_const"},{"line_number":21,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"df87a7cf_c8977feb","line":18,"in_reply_to":"df87a7cf_0a18087f","updated":"2017-12-15 01:54:18.000000000","message":"Done","commit_id":"6f4c87456bd00d555177176a67a476e387308fd0"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"c2c370093c9d5637a91d6ab0d217b0676bdf4153","unresolved":false,"context_lines":[{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def test_report_state_one_node_one_port(self):"},{"line_number":70,"context_line":"        with mock.patch.object(self.agent.state_rpc,"},{"line_number":71,"context_line":"                               \u0027report_state\u0027) as mock_report_state,\\"},{"line_number":72,"context_line":"                mock.patch.object(self.agent.ironic_client.port, \u0027list\u0027,"},{"line_number":73,"context_line":"                                  return_value\u003d[FakePort1()]):"},{"line_number":74,"context_line":"            expected \u003d {"}],"source_content_type":"text/x-python","patch_set":13,"id":"df87a7cf_0d0d8236","line":71,"range":{"start_line":71,"start_character":68,"end_line":71,"end_character":69},"updated":"2017-12-14 16:42:24.000000000","message":"Why do we need this backslash?","commit_id":"6f4c87456bd00d555177176a67a476e387308fd0"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"c2c370093c9d5637a91d6ab0d217b0676bdf4153","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    def test_report_state_two_nodes_two_ports(self):"},{"line_number":90,"context_line":"        with mock.patch.object(self.agent.state_rpc,"},{"line_number":91,"context_line":"                               \u0027report_state\u0027) as mock_report_state,\\"},{"line_number":92,"context_line":"                mock.patch.object(self.agent.ironic_client.port,"},{"line_number":93,"context_line":"                                  \u0027list\u0027,"},{"line_number":94,"context_line":"                                  return_value\u003d[FakePort1(), FakePort2()]):"}],"source_content_type":"text/x-python","patch_set":13,"id":"df87a7cf_cd0eba31","line":91,"range":{"start_line":91,"start_character":68,"end_line":91,"end_character":69},"updated":"2017-12-14 16:42:24.000000000","message":"Why do we need this backslash?","commit_id":"6f4c87456bd00d555177176a67a476e387308fd0"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"c2c370093c9d5637a91d6ab0d217b0676bdf4153","unresolved":false,"context_lines":[{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    def test_log_exceptions_failed_ironic_port_list(self):"},{"line_number":126,"context_line":"        with mock.patch.object(ironic_neutron_agent.LOG,"},{"line_number":127,"context_line":"                               \u0027exception\u0027) as mock_log,\\"},{"line_number":128,"context_line":"            mock.patch.object("},{"line_number":129,"context_line":"                self.agent.ironic_client.port, \u0027list\u0027) as mock_ironic_client:"},{"line_number":130,"context_line":"            mock_ironic_client.side_effect \u003d Exception()"}],"source_content_type":"text/x-python","patch_set":13,"id":"df87a7cf_6d1bee72","line":127,"range":{"start_line":127,"start_character":56,"end_line":127,"end_character":57},"updated":"2017-12-14 16:42:24.000000000","message":"Why do we need this backslash?","commit_id":"6f4c87456bd00d555177176a67a476e387308fd0"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"c2c370093c9d5637a91d6ab0d217b0676bdf4153","unresolved":false,"context_lines":[{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    def test_state_rpc_report_state_fail(self):"},{"line_number":135,"context_line":"        with mock.patch.object(ironic_neutron_agent.LOG,"},{"line_number":136,"context_line":"                               \u0027exception\u0027) as mock_log, \\"},{"line_number":137,"context_line":"                mock.patch.object(self.agent.ironic_client.port, \u0027list\u0027,"},{"line_number":138,"context_line":"                                  return_value\u003d[FakePort1(), FakePort2()]),\\"},{"line_number":139,"context_line":"                mock.patch.object(self.agent.state_rpc,"}],"source_content_type":"text/x-python","patch_set":13,"id":"df87a7cf_8d18b275","line":136,"range":{"start_line":136,"start_character":57,"end_line":136,"end_character":58},"updated":"2017-12-14 16:42:24.000000000","message":"Why do we need this backslash?","commit_id":"6f4c87456bd00d555177176a67a476e387308fd0"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"c2c370093c9d5637a91d6ab0d217b0676bdf4153","unresolved":false,"context_lines":[{"line_number":135,"context_line":"        with mock.patch.object(ironic_neutron_agent.LOG,"},{"line_number":136,"context_line":"                               \u0027exception\u0027) as mock_log, \\"},{"line_number":137,"context_line":"                mock.patch.object(self.agent.ironic_client.port, \u0027list\u0027,"},{"line_number":138,"context_line":"                                  return_value\u003d[FakePort1(), FakePort2()]),\\"},{"line_number":139,"context_line":"                mock.patch.object(self.agent.state_rpc,"},{"line_number":140,"context_line":"                                  \u0027report_state\u0027) as mock_report_state:"},{"line_number":141,"context_line":"            mock_report_state.side_effect \u003d Exception()"}],"source_content_type":"text/x-python","patch_set":13,"id":"df87a7cf_ed205e9e","line":138,"range":{"start_line":138,"start_character":75,"end_line":138,"end_character":76},"updated":"2017-12-14 16:42:24.000000000","message":"Why do we need this backslash?","commit_id":"6f4c87456bd00d555177176a67a476e387308fd0"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"c2c370093c9d5637a91d6ab0d217b0676bdf4153","unresolved":false,"context_lines":[{"line_number":144,"context_line":""},{"line_number":145,"context_line":"    def test_ironic_exceptions_stop_loopingcall(self):"},{"line_number":146,"context_line":"        with mock.patch.object("},{"line_number":147,"context_line":"                ironic_neutron_agent.LOG, \u0027exception\u0027) as mock_log,\\"},{"line_number":148,"context_line":"                mock.patch.object("},{"line_number":149,"context_line":"                    self.agent.ironic_client.port, \u0027list\u0027) as mock_client:"},{"line_number":150,"context_line":"            self.agent.heartbeat \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":13,"id":"df87a7cf_ad3a56ca","line":147,"range":{"start_line":147,"start_character":67,"end_line":147,"end_character":68},"updated":"2017-12-14 16:42:24.000000000","message":"Why do we need this backslash?","commit_id":"6f4c87456bd00d555177176a67a476e387308fd0"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"c2c370093c9d5637a91d6ab0d217b0676bdf4153","unresolved":false,"context_lines":[{"line_number":176,"context_line":""},{"line_number":177,"context_line":"    def test_report_state_attribute_error_stop_looping_call(self):"},{"line_number":178,"context_line":"        with mock.patch.object(ironic_neutron_agent.LOG,"},{"line_number":179,"context_line":"                               \u0027exception\u0027) as mock_log,\\"},{"line_number":180,"context_line":"                mock.patch.object(self.agent.ironic_client.port, \u0027list\u0027,"},{"line_number":181,"context_line":"                                  return_value\u003d[FakePort1(), FakePort2()]),\\"},{"line_number":182,"context_line":"                mock.patch.object(self.agent,"}],"source_content_type":"text/x-python","patch_set":13,"id":"df87a7cf_2d4c0675","line":179,"range":{"start_line":179,"start_character":56,"end_line":179,"end_character":57},"updated":"2017-12-14 16:42:24.000000000","message":"Why do we need this backslash?","commit_id":"6f4c87456bd00d555177176a67a476e387308fd0"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"c2c370093c9d5637a91d6ab0d217b0676bdf4153","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        with mock.patch.object(ironic_neutron_agent.LOG,"},{"line_number":179,"context_line":"                               \u0027exception\u0027) as mock_log,\\"},{"line_number":180,"context_line":"                mock.patch.object(self.agent.ironic_client.port, \u0027list\u0027,"},{"line_number":181,"context_line":"                                  return_value\u003d[FakePort1(), FakePort2()]),\\"},{"line_number":182,"context_line":"                mock.patch.object(self.agent,"},{"line_number":183,"context_line":"                                  \u0027state_rpc\u0027) as mock_report_state:"},{"line_number":184,"context_line":"            self.agent.heartbeat \u003d mock.Mock()"}],"source_content_type":"text/x-python","patch_set":13,"id":"df87a7cf_cd379ae3","line":181,"range":{"start_line":181,"start_character":75,"end_line":181,"end_character":76},"updated":"2017-12-14 16:42:24.000000000","message":"Why do we need this backslash?","commit_id":"6f4c87456bd00d555177176a67a476e387308fd0"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"d37d40fa4ea974aeb586a38f41c2be8d84335aeb","unresolved":false,"context_lines":[{"line_number":66,"context_line":"                         self.agent.get_template_node_state("},{"line_number":67,"context_line":"                             \u0027the_node_uuid\u0027)[\u0027host\u0027])"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    @mock.patch.object(client, \u0027Client\u0027)"},{"line_number":70,"context_line":"    def test_report_state_one_node_one_port(self, mock_client):"},{"line_number":71,"context_line":"        with mock.patch.object(self.agent.state_rpc,"},{"line_number":72,"context_line":"                               \u0027report_state\u0027) as mock_report_state:"}],"source_content_type":"text/x-python","patch_set":15,"id":"df87a7cf_78408008","line":69,"updated":"2017-12-15 05:28:52.000000000","message":"If possible please use:\n\n @mock.patch.object(client, \u0027Client\u0027, autospec\u003dTrue)\n\nor \u0027autospec\u003dFalse\u0027 if it won\u0027t work.\n\nHere and on the other ones. Also in the \u0027with mock...\u0027 usage too.","commit_id":"3c97b26beeda14ea9a90f585196b82374bfda9da"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"31e05aebb7638bc339748e9c5aa978c37ad1f5da","unresolved":false,"context_lines":[{"line_number":66,"context_line":"                         self.agent.get_template_node_state("},{"line_number":67,"context_line":"                             \u0027the_node_uuid\u0027)[\u0027host\u0027])"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    @mock.patch.object(client, \u0027Client\u0027)"},{"line_number":70,"context_line":"    def test_report_state_one_node_one_port(self, mock_client):"},{"line_number":71,"context_line":"        with mock.patch.object(self.agent.state_rpc,"},{"line_number":72,"context_line":"                               \u0027report_state\u0027) as mock_report_state:"}],"source_content_type":"text/x-python","patch_set":15,"id":"df87a7cf_a5e0bd98","line":69,"in_reply_to":"df87a7cf_78408008","updated":"2017-12-19 19:49:44.000000000","message":"False for the client bit, and True for the others.\nI think I got them all...","commit_id":"3c97b26beeda14ea9a90f585196b82374bfda9da"}],"releasenotes/notes/ironic-neutron-agent-291f8aad7d53f06c.yaml":[{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"a30c623884f0f5e183eea47a8253cd0376c962b9","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - Add neutron agent ``ironic-neutron-agent`` to enable integration with"},{"line_number":4,"context_line":"    neutron routed provider networks. The ml2 agent reports the state of"},{"line_number":5,"context_line":"    ironic ports associated with ironic nodes to neutron, it populates the"}],"source_content_type":"text/x-yaml","patch_set":25,"id":"7f96bb07_10e00dfa","line":2,"updated":"2018-01-23 20:21:12.000000000","message":"nit: this could almost be a prelude :)  It reads well!","commit_id":"0de90146b527e22bddd051dd3d02e10368ce176f"}],"setup.cfg":[{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"09e7bc222f83c6761e216c68d3626c6f5b07e532","unresolved":false,"context_lines":[{"line_number":22,"context_line":"packages \u003d"},{"line_number":23,"context_line":"    networking_baremetal"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"[entry_points]"},{"line_number":27,"context_line":"console_scripts \u003d"},{"line_number":28,"context_line":"    ironic-neutron-agent \u003d networking_baremetal.ironic_agent.main:main"}],"source_content_type":"text/x-ttcn-cfg","patch_set":2,"id":"ff0f0b1f_f61d6b73","line":25,"updated":"2017-05-22 07:45:41.000000000","message":"nit: extra empty line","commit_id":"d37a451db2523efd2a15c4d44d93da4a177d938b"}],"test-requirements.txt":[{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"17cd4197ae77e48b36f5129d17b31d1e2e362b2c","unresolved":false,"context_lines":[{"line_number":10,"context_line":"testtools\u003e\u003d2.2.0 # MIT"},{"line_number":11,"context_line":"os-testr\u003e\u003d1.0.0 # Apache-2.0"},{"line_number":12,"context_line":"testscenarios\u003e\u003d0.4 # Apache-2.0/BSD"},{"line_number":13,"context_line":"python-ironicclient\u003e\u003d1.14.0 # Apache-2.0"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"# Doc requirements"},{"line_number":16,"context_line":"sphinx\u003e\u003d1.6.2 # BSD"}],"source_content_type":"text/plain","patch_set":14,"id":"df87a7cf_05e6ad45","line":13,"updated":"2017-12-15 03:53:24.000000000","message":"I believe this should be in requirements.txt instead of test-requirements.txt","commit_id":"4d3411525d68fc5b0b2039a423d3959f8c830624"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"31e05aebb7638bc339748e9c5aa978c37ad1f5da","unresolved":false,"context_lines":[{"line_number":10,"context_line":"testtools\u003e\u003d2.2.0 # MIT"},{"line_number":11,"context_line":"os-testr\u003e\u003d1.0.0 # Apache-2.0"},{"line_number":12,"context_line":"testscenarios\u003e\u003d0.4 # Apache-2.0/BSD"},{"line_number":13,"context_line":"python-ironicclient\u003e\u003d1.14.0 # Apache-2.0"},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"# Doc requirements"},{"line_number":16,"context_line":"sphinx\u003e\u003d1.6.2 # BSD"}],"source_content_type":"text/plain","patch_set":14,"id":"df87a7cf_4042ff10","line":13,"in_reply_to":"df87a7cf_05e6ad45","updated":"2017-12-19 19:49:44.000000000","message":"Done","commit_id":"4d3411525d68fc5b0b2039a423d3959f8c830624"}]}
