)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"6b87fb8a87a6d7335ac66b27028d8cd6d8027e4e","unresolved":false,"context_lines":[{"line_number":9,"context_line":"network_device_mtu option does not have an explicit default value set,"},{"line_number":10,"context_line":"in which case it is implicitly None. Also, it can be set to e.g. 0."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"In those both cases, we should not attempt to set \u0027None\u0027 or \u00270\u0027 MTU"},{"line_number":13,"context_line":"value on interfaces, since such requests are doomed to fail."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Instead of calling to \u0027ip link\u0027 as we do now, validate MTU value first"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"1af94dfe_bfdab376","line":12,"updated":"2016-03-15 19:32:43.000000000","message":"s/those both cases/both of those cases/","commit_id":"f59c7ad12cf25769b5ea995563d06942430c08cb"}],"vif_plug_linux_bridge/linux_net.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"bbb2b67f7ee316c2a35a8eb7c3e345ffddeef258","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        if not mtu:"},{"line_number":42,"context_line":"            raise ValueError"},{"line_number":43,"context_line":"    except (ValueError, TypeError):"},{"line_number":44,"context_line":"        LOG.warning(\u0027Invalid MTU %s passed for %s; ignoring\u0027, mtu, dev)"},{"line_number":45,"context_line":"        return"},{"line_number":46,"context_line":"    processutils.execute(\u0027ip\u0027, \u0027link\u0027, \u0027set\u0027, dev, \u0027mtu\u0027, str(mtu),"},{"line_number":47,"context_line":"                         check_exit_code\u003d[0, 2, 254])"}],"source_content_type":"text/x-python","patch_set":3,"id":"7af24918_0c9cdf5b","line":44,"updated":"2016-03-03 11:42:20.000000000","message":"Need to add translation marker here...","commit_id":"9ba664db0a08509101ef4e29d9968b7b432c79e4"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"43816307eaddff525f236938f6feccde0be905ff","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        if not mtu:"},{"line_number":42,"context_line":"            raise ValueError"},{"line_number":43,"context_line":"    except (ValueError, TypeError):"},{"line_number":44,"context_line":"        LOG.warning(\u0027Invalid MTU %s passed for %s; ignoring\u0027, mtu, dev)"},{"line_number":45,"context_line":"        return"},{"line_number":46,"context_line":"    processutils.execute(\u0027ip\u0027, \u0027link\u0027, \u0027set\u0027, dev, \u0027mtu\u0027, str(mtu),"},{"line_number":47,"context_line":"                         check_exit_code\u003d[0, 2, 254])"}],"source_content_type":"text/x-python","patch_set":3,"id":"7af24918_cc1837d6","line":44,"in_reply_to":"7af24918_0c9cdf5b","updated":"2016-03-03 11:45:00.000000000","message":"Done","commit_id":"9ba664db0a08509101ef4e29d9968b7b432c79e4"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"d8b9e91f555176561007f890d1893fba18632801","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    except (ValueError, TypeError):"},{"line_number":46,"context_line":"        LOG.warning(_LW(\u0027Invalid MTU %(mtu)s passed for %(dev)s; ignoring\u0027),"},{"line_number":47,"context_line":"                    {\u0027mtu\u0027: mtu, \u0027dev\u0027: dev})"},{"line_number":48,"context_line":"        return"},{"line_number":49,"context_line":"    processutils.execute(\u0027ip\u0027, \u0027link\u0027, \u0027set\u0027, dev, \u0027mtu\u0027, str(mtu),"},{"line_number":50,"context_line":"                         check_exit_code\u003d[0, 2, 254])"},{"line_number":51,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7af24918_f47bf9f2","line":48,"range":{"start_line":48,"start_character":8,"end_line":48,"end_character":14},"updated":"2016-03-04 11:06:26.000000000","message":"This kind of check really doesn\u0027t belong in this method. The calling code should just not invoke this method if it doesn\u0027t have a MTU it wants to set. The config file option is already declared as an IntOpt, so that validates the data is an integer too, so we dont need to repeat that","commit_id":"f59c7ad12cf25769b5ea995563d06942430c08cb"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"27d127c42aa363ce7465198844d91d3c4b0734dc","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    except (ValueError, TypeError):"},{"line_number":46,"context_line":"        LOG.warning(_LW(\u0027Invalid MTU %(mtu)s passed for %(dev)s; ignoring\u0027),"},{"line_number":47,"context_line":"                    {\u0027mtu\u0027: mtu, \u0027dev\u0027: dev})"},{"line_number":48,"context_line":"        return"},{"line_number":49,"context_line":"    processutils.execute(\u0027ip\u0027, \u0027link\u0027, \u0027set\u0027, dev, \u0027mtu\u0027, str(mtu),"},{"line_number":50,"context_line":"                         check_exit_code\u003d[0, 2, 254])"},{"line_number":51,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_1e0624ce","line":48,"range":{"start_line":48,"start_character":8,"end_line":48,"end_character":14},"in_reply_to":"5aef4532_236325b3","updated":"2016-03-08 10:13:06.000000000","message":"The network object will use an IntField type, so again it will already be in integer format. It really is not the job of these methods to convert data into the right format - that\u0027s the job of the callers - either the config or the object model to handle, and they do it just fine.","commit_id":"f59c7ad12cf25769b5ea995563d06942430c08cb"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"39c56f81cd46c77cbd3b2cce01d91258e88c68c6","unresolved":false,"context_lines":[{"line_number":45,"context_line":"    except (ValueError, TypeError):"},{"line_number":46,"context_line":"        LOG.warning(_LW(\u0027Invalid MTU %(mtu)s passed for %(dev)s; ignoring\u0027),"},{"line_number":47,"context_line":"                    {\u0027mtu\u0027: mtu, \u0027dev\u0027: dev})"},{"line_number":48,"context_line":"        return"},{"line_number":49,"context_line":"    processutils.execute(\u0027ip\u0027, \u0027link\u0027, \u0027set\u0027, dev, \u0027mtu\u0027, str(mtu),"},{"line_number":50,"context_line":"                         check_exit_code\u003d[0, 2, 254])"},{"line_number":51,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_236325b3","line":48,"range":{"start_line":48,"start_character":8,"end_line":48,"end_character":14},"in_reply_to":"7af24918_f47bf9f2","updated":"2016-03-07 20:40:34.000000000","message":"what about the case where the mtu comes from the network object instead of the config? \n\nhttps://github.com/openstack/os-vif/blob/5888af0815c6ce58c5cdb4d2a2fcfc4c08b09a65/vif_plug_linux_bridge/linux_bridge.py#L98\n\ncurrently we are reading the mtu from the plugin config but nova is also being changed to prefer the mtu from the neutron network and fall back to the config value if not set.\n\nsee\nhttps://review.openstack.org/#/c/283847/6\n\n\ni agree however that im not a fan of how this is currently written.\n\ni would either log the warning directly and return \n    mtu \u003d int(mtu)\n    if not mtu:\n        LOG.warning(_LW(\u0027Invalid MTU %(mtu)s passed for %(dev)s; ignoring\u0027),\n                   {\u0027mtu\u0027: mtu, \u0027dev\u0027: dev})\n\nor my preference throw the exception and allow the caller to handle it. \n\n     mtu \u003d int(mtu)\n        if not mtu:\n            raise ValueError\n\nreturning from a set without actully setting the value seams strange to me with our signaling the error hence my preference for the second option if we do the type check as part of the function.","commit_id":"f59c7ad12cf25769b5ea995563d06942430c08cb"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"d8b9e91f555176561007f890d1893fba18632801","unresolved":false,"context_lines":[{"line_number":90,"context_line":"                             run_as_root\u003dTrue)"},{"line_number":91,"context_line":"    # NOTE(vish): set mtu every time to ensure that changes to mtu get"},{"line_number":92,"context_line":"    #             propogated"},{"line_number":93,"context_line":"    _set_device_mtu(interface, mtu)"},{"line_number":94,"context_line":"    return interface"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7af24918_54d90df2","line":93,"range":{"start_line":93,"start_character":34,"end_line":93,"end_character":35},"updated":"2016-03-04 11:06:26.000000000","message":"Just prefix this method call with  \u0027if mtu\u0027 which avoids both the None and 0 cases.","commit_id":"f59c7ad12cf25769b5ea995563d06942430c08cb"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"39c56f81cd46c77cbd3b2cce01d91258e88c68c6","unresolved":false,"context_lines":[{"line_number":90,"context_line":"                             run_as_root\u003dTrue)"},{"line_number":91,"context_line":"    # NOTE(vish): set mtu every time to ensure that changes to mtu get"},{"line_number":92,"context_line":"    #             propogated"},{"line_number":93,"context_line":"    _set_device_mtu(interface, mtu)"},{"line_number":94,"context_line":"    return interface"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_e3465dbe","line":93,"range":{"start_line":93,"start_character":34,"end_line":93,"end_character":35},"in_reply_to":"7af24918_54d90df2","updated":"2016-03-07 20:40:34.000000000","message":"that is true though the if mtu check that nova does did hide a bug with vhost-user port for over a year. \n\ndoes the neutron api check that it is a valid integer?\n\nit might be safer to do \nif not int(mtu)","commit_id":"f59c7ad12cf25769b5ea995563d06942430c08cb"},{"author":{"_account_id":9515,"name":"Matthew Kassawara","email":"mkassawara@gmail.com","username":"ionosphere80"},"change_message_id":"c360a75434d668ee8200152cdaf68c76c3d472d7","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        _set_device_mtu(interface, mtu)"},{"line_number":91,"context_line":"    else:"},{"line_number":92,"context_line":"        LOG.debug(\"MTU not set on %(interface_name)s interface\","},{"line_number":93,"context_line":"                  {\u0027interface_name\u0027: interface})"},{"line_number":94,"context_line":"    return interface"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1aa78d24_e8593cfe","line":93,"updated":"2016-07-07 18:40:44.000000000","message":"Can this error provide a season such as invalid MTU value?","commit_id":"138312122ec0d6f95487faf9f7d66c01686a39ed"},{"author":{"_account_id":9515,"name":"Matthew Kassawara","email":"mkassawara@gmail.com","username":"ionosphere80"},"change_message_id":"68fb18ccf94cce311bb7b7b8adf376d5ab8b6896","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        _set_device_mtu(interface, mtu)"},{"line_number":91,"context_line":"    else:"},{"line_number":92,"context_line":"        LOG.debug(\"MTU not set on %(interface_name)s interface\","},{"line_number":93,"context_line":"                  {\u0027interface_name\u0027: interface})"},{"line_number":94,"context_line":"    return interface"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1aa78d24_de768dd7","line":93,"in_reply_to":"1aa78d24_5f3aa4e8","updated":"2016-07-08 13:47:12.000000000","message":"True, but a lot of operators look at debug messages because the regular log messages aren\u0027t always useful. MTU is particularly confusing for operators, especially with the historical problems in OpenStack, so I prefer taking any opportunity to ease debugging of such issues.","commit_id":"138312122ec0d6f95487faf9f7d66c01686a39ed"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"16497a99d1f5b8d2d9f25e1bd54ca76e7244a57d","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        _set_device_mtu(interface, mtu)"},{"line_number":91,"context_line":"    else:"},{"line_number":92,"context_line":"        LOG.debug(\"MTU not set on %(interface_name)s interface\","},{"line_number":93,"context_line":"                  {\u0027interface_name\u0027: interface})"},{"line_number":94,"context_line":"    return interface"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1aa78d24_5f3aa4e8","line":93,"in_reply_to":"1aa78d24_e8593cfe","updated":"2016-07-08 10:34:27.000000000","message":"i could but this is a debug level log so its not intended for an operator to view and as a developer i think its clear that if this is printed looking at the code it means that mtu was either 0,false or none to cause the if to fail.","commit_id":"138312122ec0d6f95487faf9f7d66c01686a39ed"}],"vif_plug_linux_bridge/tests/test_linux_net.py":[{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"7090abf0a5ea7c3f7d9301ca3c35a9b25e13cfa1","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        super(LinuxNetTest, self).setUp()"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"        privsep.vif_plug.set_client_mode(False)"},{"line_number":45,"context_line":"        lock_path \u003d self.useFixture(fixtures.TempDir()).path"},{"line_number":46,"context_line":"        self.fixture \u003d self.useFixture("},{"line_number":47,"context_line":"            config_fixture.Config(lockutils.CONF))"},{"line_number":48,"context_line":"        self.fixture.config(lock_path\u003dlock_path,"},{"line_number":49,"context_line":"                            group\u003d\u0027oslo_concurrency\u0027)"},{"line_number":50,"context_line":"        self.useFixture(log_fixture.get_logging_handle_error_fixture())"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    @mock.patch.object(processutils, \"execute\")"},{"line_number":53,"context_line":"    def test_set_device_mtu(self, execute):"}],"source_content_type":"text/x-python","patch_set":5,"id":"7aa08908_d4e8fb18","line":50,"range":{"start_line":45,"start_character":8,"end_line":50,"end_character":71},"updated":"2016-06-10 17:01:51.000000000","message":"why do you need all these fixtures if you are just mocking\noslo_concurrency.execute?","commit_id":"138312122ec0d6f95487faf9f7d66c01686a39ed"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"226a8335657d939fff082906bf5b4452b80d2665","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        super(LinuxNetTest, self).setUp()"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"        privsep.vif_plug.set_client_mode(False)"},{"line_number":45,"context_line":"        lock_path \u003d self.useFixture(fixtures.TempDir()).path"},{"line_number":46,"context_line":"        self.fixture \u003d self.useFixture("},{"line_number":47,"context_line":"            config_fixture.Config(lockutils.CONF))"},{"line_number":48,"context_line":"        self.fixture.config(lock_path\u003dlock_path,"},{"line_number":49,"context_line":"                            group\u003d\u0027oslo_concurrency\u0027)"},{"line_number":50,"context_line":"        self.useFixture(log_fixture.get_logging_handle_error_fixture())"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    @mock.patch.object(processutils, \"execute\")"},{"line_number":53,"context_line":"    def test_set_device_mtu(self, execute):"}],"source_content_type":"text/x-python","patch_set":5,"id":"7aa08908_c00c7cee","line":50,"range":{"start_line":45,"start_character":8,"end_line":50,"end_character":71},"in_reply_to":"7aa08908_d4e8fb18","updated":"2016-06-13 11:06:55.000000000","message":"we need them because of the @lockutils.synchronized\ndecorator.\n\nhttps://github.com/openstack/os-vif/blob/master/vif_plug_linux_bridge/linux_net.py#L65\n\nthe logging fixture is for \nhttps://github.com/openstack/os-vif/blob/master/vif_plug_linux_bridge/linux_net.py#L74\nand any other use of LOG we may have if we add more tests in the future.\n\nour current test coverage is a little light so i expect in future we will have more tests for linux_net.py where logging will have to be mocked and the fixture seams to be the best approach.","commit_id":"138312122ec0d6f95487faf9f7d66c01686a39ed"}],"vif_plug_ovs/linux_net.py":[{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"d8b9e91f555176561007f890d1893fba18632801","unresolved":false,"context_lines":[{"line_number":55,"context_line":"                \u0027external-ids:attached-mac\u003d%s\u0027 % mac,"},{"line_number":56,"context_line":"                \u0027external-ids:vm-uuid\u003d%s\u0027 % instance_id],"},{"line_number":57,"context_line":"                timeout\u003dtimeout)"},{"line_number":58,"context_line":"    _set_device_mtu(dev, mtu)"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"def delete_ovs_vif_port(bridge, dev, timeout\u003dNone):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7af24918_74052944","line":58,"range":{"start_line":58,"start_character":28,"end_line":58,"end_character":29},"updated":"2016-03-04 11:06:26.000000000","message":"Just add  \u0027if mtu\u0027 before this call","commit_id":"f59c7ad12cf25769b5ea995563d06942430c08cb"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"d8b9e91f555176561007f890d1893fba18632801","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        processutils.execute(\u0027ip\u0027, \u0027link\u0027, \u0027set\u0027, dev, \u0027up\u0027,"},{"line_number":97,"context_line":"                             run_as_root\u003dTrue)"},{"line_number":98,"context_line":"        processutils.execute(\u0027ip\u0027, \u0027link\u0027, \u0027set\u0027, dev, \u0027promisc\u0027, \u0027on\u0027)"},{"line_number":99,"context_line":"        _set_device_mtu(dev, mtu)"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"def _set_device_mtu(dev, mtu):"}],"source_content_type":"text/x-python","patch_set":4,"id":"7af24918_5400ed33","line":99,"range":{"start_line":99,"start_character":32,"end_line":99,"end_character":33},"updated":"2016-03-04 11:06:26.000000000","message":"And add  \u0027if mtu\u0027 here too","commit_id":"f59c7ad12cf25769b5ea995563d06942430c08cb"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"d8b9e91f555176561007f890d1893fba18632801","unresolved":false,"context_lines":[{"line_number":108,"context_line":"    except (ValueError, TypeError):"},{"line_number":109,"context_line":"        LOG.warning(_LW(\u0027Invalid MTU %(mtu)s passed for %(dev)s; ignoring\u0027),"},{"line_number":110,"context_line":"                    {\u0027mtu\u0027: mtu, \u0027dev\u0027: dev})"},{"line_number":111,"context_line":"        return"},{"line_number":112,"context_line":"    processutils.execute(\u0027ip\u0027, \u0027link\u0027, \u0027set\u0027, dev, \u0027mtu\u0027, str(mtu),"},{"line_number":113,"context_line":"                         check_exit_code\u003d[0, 2, 254])"}],"source_content_type":"text/x-python","patch_set":4,"id":"7af24918_74cd2965","line":111,"range":{"start_line":111,"start_character":8,"end_line":111,"end_character":14},"updated":"2016-03-04 11:06:26.000000000","message":"Same comment as other file, this doesn\u0027t belong here.","commit_id":"f59c7ad12cf25769b5ea995563d06942430c08cb"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"39c56f81cd46c77cbd3b2cce01d91258e88c68c6","unresolved":false,"context_lines":[{"line_number":109,"context_line":"        LOG.warning(_LW(\u0027Invalid MTU %(mtu)s passed for %(dev)s; ignoring\u0027),"},{"line_number":110,"context_line":"                    {\u0027mtu\u0027: mtu, \u0027dev\u0027: dev})"},{"line_number":111,"context_line":"        return"},{"line_number":112,"context_line":"    processutils.execute(\u0027ip\u0027, \u0027link\u0027, \u0027set\u0027, dev, \u0027mtu\u0027, str(mtu),"},{"line_number":113,"context_line":"                         check_exit_code\u003d[0, 2, 254])"}],"source_content_type":"text/x-python","patch_set":4,"id":"7af24918_1b81868f","line":112,"range":{"start_line":112,"start_character":58,"end_line":112,"end_character":66},"updated":"2016-03-07 20:40:34.000000000","message":"is the str strictly required? should the value not be converted implicitly","commit_id":"f59c7ad12cf25769b5ea995563d06942430c08cb"}]}
