)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"5c8b695107ffbf41b05e94d0d6e6b366f5e561e3","unresolved":false,"context_lines":[{"line_number":14,"context_line":"has no attribute \u0027rstrip\u0027\". Even if we format the tupple to string, the"},{"line_number":15,"context_line":"command will still not success, because the righ way to save configuration"},{"line_number":16,"context_line":"is like this:"},{"line_number":17,"context_line":"        self.enable()"},{"line_number":18,"context_line":"        self.send_command(command_string\u003d\u0027write\u0027, expect_string\u003d\u0027[Yes\u0027)"},{"line_number":19,"context_line":"        self.send_command(command_string\u003d\u0027Yes\u0027)"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"So if we want to save configuration successfuly, we need to do a big"},{"line_number":22,"context_line":"change. We don\u0027t need to do this because netmiko is working to provide"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5f93b717_95eb3311","line":19,"range":{"start_line":17,"start_character":8,"end_line":19,"end_character":47},"updated":"2018-02-02 08:16:20.000000000","message":"It depends of the device, for IoS you can use \u0027write memory\u0027 and it will save config.\n\nThe whole thread in netmiko was started a long time ago when we found this issue and looks like now it almost implemented https://github.com/ktbyers/netmiko/issues/441.","commit_id":"57afa35891c1a0fab393a16597875e042634a77d"},{"author":{"_account_id":10453,"name":"octopuszhang","email":"zhangyf@rc.inesa.com","username":"1"},"change_message_id":"9f9fb012d55c87e94c4b975798bfeeeaa81726ca","unresolved":false,"context_lines":[{"line_number":14,"context_line":"has no attribute \u0027rstrip\u0027\". Even if we format the tupple to string, the"},{"line_number":15,"context_line":"command will still not success, because the righ way to save configuration"},{"line_number":16,"context_line":"is like this:"},{"line_number":17,"context_line":"        self.enable()"},{"line_number":18,"context_line":"        self.send_command(command_string\u003d\u0027write\u0027, expect_string\u003d\u0027[Yes\u0027)"},{"line_number":19,"context_line":"        self.send_command(command_string\u003d\u0027Yes\u0027)"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"So if we want to save configuration successfuly, we need to do a big"},{"line_number":22,"context_line":"change. We don\u0027t need to do this because netmiko is working to provide"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5f93b717_e8489ab3","line":19,"range":{"start_line":17,"start_character":8,"end_line":19,"end_character":47},"in_reply_to":"5f93b717_88a316b2","updated":"2018-02-02 09:41:40.000000000","message":"OK, let me register a new bug for this. Just solve format problem in this patch. Keep this patch simple.","commit_id":"57afa35891c1a0fab393a16597875e042634a77d"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"fe139720c818c82d740650a7f11a7269c24994db","unresolved":false,"context_lines":[{"line_number":14,"context_line":"has no attribute \u0027rstrip\u0027\". Even if we format the tupple to string, the"},{"line_number":15,"context_line":"command will still not success, because the righ way to save configuration"},{"line_number":16,"context_line":"is like this:"},{"line_number":17,"context_line":"        self.enable()"},{"line_number":18,"context_line":"        self.send_command(command_string\u003d\u0027write\u0027, expect_string\u003d\u0027[Yes\u0027)"},{"line_number":19,"context_line":"        self.send_command(command_string\u003d\u0027Yes\u0027)"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"So if we want to save configuration successfuly, we need to do a big"},{"line_number":22,"context_line":"change. We don\u0027t need to do this because netmiko is working to provide"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5f93b717_88a316b2","line":19,"range":{"start_line":17,"start_character":8,"end_line":19,"end_character":47},"in_reply_to":"5f93b717_95eb3311","updated":"2018-02-02 09:32:03.000000000","message":"This seems like a separate issue, specific to some devices.","commit_id":"57afa35891c1a0fab393a16597875e042634a77d"},{"author":{"_account_id":10453,"name":"octopuszhang","email":"zhangyf@rc.inesa.com","username":"1"},"change_message_id":"1b1b2deaa1cc66b5db43b3ad693035686fc1cc7a","unresolved":false,"context_lines":[{"line_number":14,"context_line":"has no attribute \u0027rstrip\u0027\". Even if we format the tupple to string, the"},{"line_number":15,"context_line":"command will still not success, because the righ way to save configuration"},{"line_number":16,"context_line":"is like this:"},{"line_number":17,"context_line":"        self.enable()"},{"line_number":18,"context_line":"        self.send_command(command_string\u003d\u0027write\u0027, expect_string\u003d\u0027[Yes\u0027)"},{"line_number":19,"context_line":"        self.send_command(command_string\u003d\u0027Yes\u0027)"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"So if we want to save configuration successfuly, we need to do a big"},{"line_number":22,"context_line":"change. We don\u0027t need to do this because netmiko is working to provide"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5f93b717_cbd8381f","line":19,"range":{"start_line":17,"start_character":8,"end_line":19,"end_character":47},"in_reply_to":"5f93b717_e8489ab3","updated":"2018-02-02 10:28:07.000000000","message":"bug is submitted at:\nhttps://bugs.launchpad.net/networking-generic-switch/+bug/1746962","commit_id":"57afa35891c1a0fab393a16597875e042634a77d"}],"networking_generic_switch/devices/netmiko_devices/__init__.py":[{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"5c8b695107ffbf41b05e94d0d6e6b366f5e561e3","unresolved":false,"context_lines":[{"line_number":200,"context_line":"        net_connect.enable()"},{"line_number":201,"context_line":"        return net_connect.send_config_set(config_commands\u003dcmd_set)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    def save_configuration(self, net_connect):"},{"line_number":204,"context_line":"        \"\"\"Save the device\u0027s configuration."},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        :param net_connect: a netmiko connection object."}],"source_content_type":"text/x-python","patch_set":1,"id":"5f93b717_75cd47b5","side":"PARENT","line":203,"updated":"2018-02-02 08:16:20.000000000","message":"instead of dropping this my suggestion is to convert tuple to string https://github.com/openstack/networking-generic-switch/blob/master/networking_generic_switch/devices/netmiko_devices/__init__.py#L209\n\nand get back to netmiko natively supported save_config() when it is supported in release netmiko that we are using.","commit_id":"1b2b39e794a43684940ef3610cbca2a87cd85eb0"},{"author":{"_account_id":10453,"name":"octopuszhang","email":"zhangyf@rc.inesa.com","username":"1"},"change_message_id":"9f9fb012d55c87e94c4b975798bfeeeaa81726ca","unresolved":false,"context_lines":[{"line_number":200,"context_line":"        net_connect.enable()"},{"line_number":201,"context_line":"        return net_connect.send_config_set(config_commands\u003dcmd_set)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    def save_configuration(self, net_connect):"},{"line_number":204,"context_line":"        \"\"\"Save the device\u0027s configuration."},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        :param net_connect: a netmiko connection object."}],"source_content_type":"text/x-python","patch_set":1,"id":"5f93b717_286a0219","side":"PARENT","line":203,"in_reply_to":"5f93b717_08d2a628","updated":"2018-02-02 09:41:40.000000000","message":"This could solve problem for some switches.","commit_id":"1b2b39e794a43684940ef3610cbca2a87cd85eb0"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"fe139720c818c82d740650a7f11a7269c24994db","unresolved":false,"context_lines":[{"line_number":200,"context_line":"        net_connect.enable()"},{"line_number":201,"context_line":"        return net_connect.send_config_set(config_commands\u003dcmd_set)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    def save_configuration(self, net_connect):"},{"line_number":204,"context_line":"        \"\"\"Save the device\u0027s configuration."},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        :param net_connect: a netmiko connection object."}],"source_content_type":"text/x-python","patch_set":1,"id":"5f93b717_08d2a628","side":"PARENT","line":203,"in_reply_to":"5f93b717_281f6208","updated":"2018-02-02 09:32:03.000000000","message":"Ok, yes you\u0027re right. How about:\n\nfor cmd in self.SAVE_CONFIGURATION:\n    net_connect.send_command(cmd)","commit_id":"1b2b39e794a43684940ef3610cbca2a87cd85eb0"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"cacefa7eab6acd550c711554e411e651749551a0","unresolved":false,"context_lines":[{"line_number":200,"context_line":"        net_connect.enable()"},{"line_number":201,"context_line":"        return net_connect.send_config_set(config_commands\u003dcmd_set)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    def save_configuration(self, net_connect):"},{"line_number":204,"context_line":"        \"\"\"Save the device\u0027s configuration."},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        :param net_connect: a netmiko connection object."}],"source_content_type":"text/x-python","patch_set":1,"id":"5f93b717_e843ba3d","side":"PARENT","line":203,"in_reply_to":"5f93b717_75cd47b5","updated":"2018-02-02 09:10:22.000000000","message":"alternatively, could we just use send_config_set() instead of send_command()?","commit_id":"1b2b39e794a43684940ef3610cbca2a87cd85eb0"},{"author":{"_account_id":10453,"name":"octopuszhang","email":"zhangyf@rc.inesa.com","username":"1"},"change_message_id":"9c1e824ca50ee6243b5fbef0b2be80465238ddf3","unresolved":false,"context_lines":[{"line_number":200,"context_line":"        net_connect.enable()"},{"line_number":201,"context_line":"        return net_connect.send_config_set(config_commands\u003dcmd_set)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    def save_configuration(self, net_connect):"},{"line_number":204,"context_line":"        \"\"\"Save the device\u0027s configuration."},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        :param net_connect: a netmiko connection object."}],"source_content_type":"text/x-python","patch_set":1,"id":"5f93b717_281f6208","side":"PARENT","line":203,"in_reply_to":"5f93b717_e843ba3d","updated":"2018-02-02 09:26:28.000000000","message":"No，they are different, send config always works in configure mode, send command doesn\u0027t. I don\u0027t other switches, for cisco 300, save command is not supported in configure mode.","commit_id":"1b2b39e794a43684940ef3610cbca2a87cd85eb0"}],"networking_generic_switch/tests/unit/netmiko/test_netmiko_base.py":[{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"956db953c189c30108be0b35588dfccf88a2f8f7","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        connect_mock \u003d mock.MagicMock(netmiko.base_connection.BaseConnection)"},{"line_number":235,"context_line":"        self.switch.save_configuration(connect_mock)"},{"line_number":236,"context_line":"        self.assertTrue(connect_mock.send_command.called_once_with(\u0027save\u0027))"},{"line_number":237,"context_line":"        self.assertTrue(connect_mock.send_command.called_once_with(\u0027y\u0027))"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"    @mock.patch.object(netmiko_devices.ngs_lock, \u0027PoolLock\u0027, autospec\u003dTrue)"},{"line_number":240,"context_line":"    @mock.patch.object(netmiko_devices.netmiko, \u0027ConnectHandler\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa0c359_320fad2f","line":237,"updated":"2018-02-05 09:50:38.000000000","message":"I think this is why the problem was not found - this assertion is incorrect:\n\n\u003e\u003e\u003e import mock\n\u003e\u003e\u003e m \u003d mock.Mock()\n\u003e\u003e\u003e m.called_once_with()\n\u003cMock name\u003d\u0027mock.called_once_with()\u0027 id\u003d\u0027140310373373904\u0027\u003e\n\u003e\u003e\u003e m.assert_called_once_with()\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n  File \"/usr/lib/python2.7/dist-packages/mock/mock.py\", line 947, in assert_called_once_with\n    raise AssertionError(msg)\nAssertionError: Expected \u0027mock\u0027 to be called once. Called 0 times.\n\nIt should have used assert_called_once_with(). Now that there are two calls, we need to check .assert_has_calls().\n\nWe could also add autospec\u003dTrue to the mock.patch.object() call to catch these issues.","commit_id":"38f13588da622c92eeb34110970d33323e166ad9"},{"author":{"_account_id":14826,"name":"Mark Goddard","email":"markgoddard86@gmail.com","username":"mgoddard"},"change_message_id":"b8771465cd4165f39e9ce1db39416cb1bc320a73","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        connect_mock \u003d mock.MagicMock(netmiko.base_connection.BaseConnection)"},{"line_number":235,"context_line":"        self.switch.save_configuration(connect_mock)"},{"line_number":236,"context_line":"        self.assertTrue(connect_mock.send_command.called_once_with(\u0027save\u0027))"},{"line_number":237,"context_line":"        self.assertTrue(connect_mock.send_command.called_once_with(\u0027y\u0027))"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"    @mock.patch.object(netmiko_devices.ngs_lock, \u0027PoolLock\u0027, autospec\u003dTrue)"},{"line_number":240,"context_line":"    @mock.patch.object(netmiko_devices.netmiko, \u0027ConnectHandler\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa0c359_7fe64eeb","line":237,"in_reply_to":"3fa0c359_320fad2f","updated":"2018-02-05 20:27:55.000000000","message":"Pushed an update that resolves this.","commit_id":"38f13588da622c92eeb34110970d33323e166ad9"},{"author":{"_account_id":10453,"name":"octopuszhang","email":"zhangyf@rc.inesa.com","username":"1"},"change_message_id":"d638dffc213508649e3c84303b77174cd280dad9","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        connect_mock \u003d mock.MagicMock(netmiko.base_connection.BaseConnection)"},{"line_number":235,"context_line":"        self.switch.save_configuration(connect_mock)"},{"line_number":236,"context_line":"        self.assertTrue(connect_mock.send_command.called_once_with(\u0027save\u0027))"},{"line_number":237,"context_line":"        self.assertTrue(connect_mock.send_command.called_once_with(\u0027y\u0027))"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"    @mock.patch.object(netmiko_devices.ngs_lock, \u0027PoolLock\u0027, autospec\u003dTrue)"},{"line_number":240,"context_line":"    @mock.patch.object(netmiko_devices.netmiko, \u0027ConnectHandler\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3fa0c359_dab1a9e3","line":237,"in_reply_to":"3fa0c359_7fe64eeb","updated":"2018-02-06 02:32:29.000000000","message":"Thanks for your help！","commit_id":"38f13588da622c92eeb34110970d33323e166ad9"}]}
