)]}'
{"cinder/tests/unit/test_storwize_svc.py":[{"author":{"_account_id":8912,"name":"Ryan McNair","email":"rdmcnair@us.ibm.com","username":"rdmcnair"},"change_message_id":"851e85e16076f29d90aa560248825b5a318d70e6","unresolved":false,"context_lines":[{"line_number":2777,"context_line":""},{"line_number":2778,"context_line":"    @mock.patch.object(ssh_utils, \u0027SSHPool\u0027)"},{"line_number":2779,"context_line":"    @mock.patch.object(processutils, \u0027ssh_execute\u0027)"},{"line_number":2780,"context_line":"    @mock.patch.object(storwize_svc_common.StorwizeSVCCommonDriver,"},{"line_number":2781,"context_line":"                       \u0027_toggle_ip\u0027)"},{"line_number":2782,"context_line":"    def test_run_ssh_both_ip_not_set_failure(self, mock_toggle,"},{"line_number":2783,"context_line":"                                             mock_ssh_execute, mock_ssh_pool):"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba0121b8_951228b3","line":2780,"updated":"2016-03-29 14:18:38.000000000","message":"Since we don\u0027t seem to have any coverage on _toggle_ip it would be nice to flex it\u0027s muscles at some point along the way. One option would be instead of mocking it out here, just use set_flag to update san_ip and san_secondary_ip to whatever we need and then don\u0027t mock _toggle_ip","commit_id":"7102d376e883e481c8ab2d0928257effc2ef53e1"},{"author":{"_account_id":17405,"name":"Jacob Gregor","email":"jgregor@us.ibm.com","username":"jgregor"},"change_message_id":"df5d06306b472d37a56e6c299eedfdbc85b501e5","unresolved":false,"context_lines":[{"line_number":2777,"context_line":""},{"line_number":2778,"context_line":"    @mock.patch.object(ssh_utils, \u0027SSHPool\u0027)"},{"line_number":2779,"context_line":"    @mock.patch.object(processutils, \u0027ssh_execute\u0027)"},{"line_number":2780,"context_line":"    @mock.patch.object(storwize_svc_common.StorwizeSVCCommonDriver,"},{"line_number":2781,"context_line":"                       \u0027_toggle_ip\u0027)"},{"line_number":2782,"context_line":"    def test_run_ssh_both_ip_not_set_failure(self, mock_toggle,"},{"line_number":2783,"context_line":"                                             mock_ssh_execute, mock_ssh_pool):"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba0121b8_fd433140","line":2780,"in_reply_to":"ba0121b8_00a523b4","updated":"2016-03-30 20:39:47.000000000","message":"Done","commit_id":"7102d376e883e481c8ab2d0928257effc2ef53e1"},{"author":{"_account_id":17405,"name":"Jacob Gregor","email":"jgregor@us.ibm.com","username":"jgregor"},"change_message_id":"ebf49f688ff841a9362a8eaa311d774b3483c24c","unresolved":false,"context_lines":[{"line_number":2777,"context_line":""},{"line_number":2778,"context_line":"    @mock.patch.object(ssh_utils, \u0027SSHPool\u0027)"},{"line_number":2779,"context_line":"    @mock.patch.object(processutils, \u0027ssh_execute\u0027)"},{"line_number":2780,"context_line":"    @mock.patch.object(storwize_svc_common.StorwizeSVCCommonDriver,"},{"line_number":2781,"context_line":"                       \u0027_toggle_ip\u0027)"},{"line_number":2782,"context_line":"    def test_run_ssh_both_ip_not_set_failure(self, mock_toggle,"},{"line_number":2783,"context_line":"                                             mock_ssh_execute, mock_ssh_pool):"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba0121b8_00a523b4","line":2780,"in_reply_to":"ba0121b8_951228b3","updated":"2016-03-29 20:44:59.000000000","message":"That sounds like a good idea. I will implement that in the next patch set.","commit_id":"7102d376e883e481c8ab2d0928257effc2ef53e1"},{"author":{"_account_id":8912,"name":"Ryan McNair","email":"rdmcnair@us.ibm.com","username":"rdmcnair"},"change_message_id":"851e85e16076f29d90aa560248825b5a318d70e6","unresolved":false,"context_lines":[{"line_number":2779,"context_line":"    @mock.patch.object(processutils, \u0027ssh_execute\u0027)"},{"line_number":2780,"context_line":"    @mock.patch.object(storwize_svc_common.StorwizeSVCCommonDriver,"},{"line_number":2781,"context_line":"                       \u0027_toggle_ip\u0027)"},{"line_number":2782,"context_line":"    def test_run_ssh_both_ip_not_set_failure(self, mock_toggle,"},{"line_number":2783,"context_line":"                                             mock_ssh_execute, mock_ssh_pool):"},{"line_number":2784,"context_line":"        mock_ssh_pool.side_effect \u003d ["},{"line_number":2785,"context_line":"            paramiko.SSHException,"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba0121b8_f5a0c492","line":2782,"updated":"2016-03-29 14:18:38.000000000","message":"Doesn\u0027t hurt to have the extra coverage, but what is this testing specifically? The name indicates that neither san_ip nor san_secondary_ip are set, but would the driver start if that were the case? \n\nIt could be that this is checking if either IP is reachable (instead of just set) which seems reasonable, but then the name is a bit misleading.","commit_id":"7102d376e883e481c8ab2d0928257effc2ef53e1"},{"author":{"_account_id":17405,"name":"Jacob Gregor","email":"jgregor@us.ibm.com","username":"jgregor"},"change_message_id":"df5d06306b472d37a56e6c299eedfdbc85b501e5","unresolved":false,"context_lines":[{"line_number":2779,"context_line":"    @mock.patch.object(processutils, \u0027ssh_execute\u0027)"},{"line_number":2780,"context_line":"    @mock.patch.object(storwize_svc_common.StorwizeSVCCommonDriver,"},{"line_number":2781,"context_line":"                       \u0027_toggle_ip\u0027)"},{"line_number":2782,"context_line":"    def test_run_ssh_both_ip_not_set_failure(self, mock_toggle,"},{"line_number":2783,"context_line":"                                             mock_ssh_execute, mock_ssh_pool):"},{"line_number":2784,"context_line":"        mock_ssh_pool.side_effect \u003d ["},{"line_number":2785,"context_line":"            paramiko.SSHException,"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba0121b8_dd40ed36","line":2782,"in_reply_to":"ba0121b8_e692d956","updated":"2016-03-30 20:39:47.000000000","message":"Done","commit_id":"7102d376e883e481c8ab2d0928257effc2ef53e1"},{"author":{"_account_id":17405,"name":"Jacob Gregor","email":"jgregor@us.ibm.com","username":"jgregor"},"change_message_id":"ebf49f688ff841a9362a8eaa311d774b3483c24c","unresolved":false,"context_lines":[{"line_number":2779,"context_line":"    @mock.patch.object(processutils, \u0027ssh_execute\u0027)"},{"line_number":2780,"context_line":"    @mock.patch.object(storwize_svc_common.StorwizeSVCCommonDriver,"},{"line_number":2781,"context_line":"                       \u0027_toggle_ip\u0027)"},{"line_number":2782,"context_line":"    def test_run_ssh_both_ip_not_set_failure(self, mock_toggle,"},{"line_number":2783,"context_line":"                                             mock_ssh_execute, mock_ssh_pool):"},{"line_number":2784,"context_line":"        mock_ssh_pool.side_effect \u003d ["},{"line_number":2785,"context_line":"            paramiko.SSHException,"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba0121b8_e692d956","line":2782,"in_reply_to":"ba0121b8_f5a0c492","updated":"2016-03-29 20:44:59.000000000","message":"Yep, I am checking that if either IP is not reachable, the proper error is raised. I can rename this test so that it is not misleading.","commit_id":"7102d376e883e481c8ab2d0928257effc2ef53e1"},{"author":{"_account_id":8912,"name":"Ryan McNair","email":"rdmcnair@us.ibm.com","username":"rdmcnair"},"change_message_id":"851e85e16076f29d90aa560248825b5a318d70e6","unresolved":false,"context_lines":[{"line_number":2794,"context_line":"    @mock.patch.object(ssh_utils, \u0027SSHPool\u0027)"},{"line_number":2795,"context_line":"    @mock.patch.object(processutils, \u0027ssh_execute\u0027)"},{"line_number":2796,"context_line":"    def test_run_ssh_both_ip_set_failure(self, mock_ssh_execute,"},{"line_number":2797,"context_line":"                                         mock_ssh_pool):"},{"line_number":2798,"context_line":"        mock_ssh_pool.side_effect \u003d ["},{"line_number":2799,"context_line":"            paramiko.SSHException,"},{"line_number":2800,"context_line":"            mock.MagicMock("}],"source_content_type":"text/x-python","patch_set":3,"id":"ba0121b8_15dc58e3","line":2797,"updated":"2016-03-29 14:18:38.000000000","message":"Just trying to follow along myself - this tests that if you were to fail to setup SSHPool with san_ip, you failover to SSHPool with secondary, and that if that ends up still failing you get an error raised?","commit_id":"7102d376e883e481c8ab2d0928257effc2ef53e1"},{"author":{"_account_id":17405,"name":"Jacob Gregor","email":"jgregor@us.ibm.com","username":"jgregor"},"change_message_id":"df5d06306b472d37a56e6c299eedfdbc85b501e5","unresolved":false,"context_lines":[{"line_number":2794,"context_line":"    @mock.patch.object(ssh_utils, \u0027SSHPool\u0027)"},{"line_number":2795,"context_line":"    @mock.patch.object(processutils, \u0027ssh_execute\u0027)"},{"line_number":2796,"context_line":"    def test_run_ssh_both_ip_set_failure(self, mock_ssh_execute,"},{"line_number":2797,"context_line":"                                         mock_ssh_pool):"},{"line_number":2798,"context_line":"        mock_ssh_pool.side_effect \u003d ["},{"line_number":2799,"context_line":"            paramiko.SSHException,"},{"line_number":2800,"context_line":"            mock.MagicMock("}],"source_content_type":"text/x-python","patch_set":3,"id":"ba0121b8_9d7155ab","line":2797,"in_reply_to":"ba0121b8_00640347","updated":"2016-03-30 20:39:47.000000000","message":"Took out some extra code that should help readability a bit.","commit_id":"7102d376e883e481c8ab2d0928257effc2ef53e1"},{"author":{"_account_id":17405,"name":"Jacob Gregor","email":"jgregor@us.ibm.com","username":"jgregor"},"change_message_id":"ebf49f688ff841a9362a8eaa311d774b3483c24c","unresolved":false,"context_lines":[{"line_number":2794,"context_line":"    @mock.patch.object(ssh_utils, \u0027SSHPool\u0027)"},{"line_number":2795,"context_line":"    @mock.patch.object(processutils, \u0027ssh_execute\u0027)"},{"line_number":2796,"context_line":"    def test_run_ssh_both_ip_set_failure(self, mock_ssh_execute,"},{"line_number":2797,"context_line":"                                         mock_ssh_pool):"},{"line_number":2798,"context_line":"        mock_ssh_pool.side_effect \u003d ["},{"line_number":2799,"context_line":"            paramiko.SSHException,"},{"line_number":2800,"context_line":"            mock.MagicMock("}],"source_content_type":"text/x-python","patch_set":3,"id":"ba0121b8_00640347","line":2797,"in_reply_to":"ba0121b8_15dc58e3","updated":"2016-03-29 20:44:59.000000000","message":"This test makes sure the proper error is raised when both san_ip and storwize_san_secondary_ip fail executing a ssh command. I will double check to see if there is something I can change to make this test easier to follow.","commit_id":"7102d376e883e481c8ab2d0928257effc2ef53e1"},{"author":{"_account_id":8912,"name":"Ryan McNair","email":"rdmcnair@us.ibm.com","username":"rdmcnair"},"change_message_id":"851e85e16076f29d90aa560248825b5a318d70e6","unresolved":false,"context_lines":[{"line_number":2808,"context_line":"                          self._driver._run_ssh, ssh_cmd)"},{"line_number":2809,"context_line":""},{"line_number":2810,"context_line":"    @mock.patch.object(ssh_utils, \u0027SSHPool\u0027)"},{"line_number":2811,"context_line":"    @mock.patch.object(processutils, \u0027ssh_execute\u0027)"},{"line_number":2812,"context_line":"    @mock.patch.object(storwize_svc_common.StorwizeSVCCommonDriver,"},{"line_number":2813,"context_line":"                       \u0027_toggle_ip\u0027)"},{"line_number":2814,"context_line":"    def test_run_ssh_second_ip_not_set_failure(self, mock_toggle,"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba0121b8_158a98bf","line":2811,"updated":"2016-03-29 14:18:38.000000000","message":"Same as above, where instead of mocking out _toggle_ip it seems like it\u0027d be good coverage to just actually set storwize_san_secondary_ip to None","commit_id":"7102d376e883e481c8ab2d0928257effc2ef53e1"},{"author":{"_account_id":17405,"name":"Jacob Gregor","email":"jgregor@us.ibm.com","username":"jgregor"},"change_message_id":"df5d06306b472d37a56e6c299eedfdbc85b501e5","unresolved":false,"context_lines":[{"line_number":2808,"context_line":"                          self._driver._run_ssh, ssh_cmd)"},{"line_number":2809,"context_line":""},{"line_number":2810,"context_line":"    @mock.patch.object(ssh_utils, \u0027SSHPool\u0027)"},{"line_number":2811,"context_line":"    @mock.patch.object(processutils, \u0027ssh_execute\u0027)"},{"line_number":2812,"context_line":"    @mock.patch.object(storwize_svc_common.StorwizeSVCCommonDriver,"},{"line_number":2813,"context_line":"                       \u0027_toggle_ip\u0027)"},{"line_number":2814,"context_line":"    def test_run_ssh_second_ip_not_set_failure(self, mock_toggle,"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba0121b8_fd6a11b2","line":2811,"in_reply_to":"ba0121b8_158a98bf","updated":"2016-03-30 20:39:47.000000000","message":"Done","commit_id":"7102d376e883e481c8ab2d0928257effc2ef53e1"},{"author":{"_account_id":8912,"name":"Ryan McNair","email":"rdmcnair@us.ibm.com","username":"rdmcnair"},"change_message_id":"851e85e16076f29d90aa560248825b5a318d70e6","unresolved":false,"context_lines":[{"line_number":2827,"context_line":"    def test_run_ssh_consistent_active_ip(self, mock_ssh_execute,"},{"line_number":2828,"context_line":"                                          mock_ssh_pool):"},{"line_number":2829,"context_line":"        # Make sure active_ip has same value in multiple success runs"},{"line_number":2830,"context_line":"        mock_ssh_execute.side_effect \u003d [paramiko.SSHException,"},{"line_number":2831,"context_line":"                                        mock.MagicMock()]"},{"line_number":2832,"context_line":"        ssh_cmd \u003d [\u0027svcinfo\u0027]"},{"line_number":2833,"context_line":"        self._driver._run_ssh(ssh_cmd)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba0121b8_c0e22003","line":2830,"updated":"2016-03-29 14:18:38.000000000","message":"Is this testing multiple successful runs? It looks like it\u0027s doing one failure, one success.  I\u0027d have expected something where  mock_ssh_execute always returns a MagicMock and we run a few _run_ssh and ensure active_ip is still san_ip (or something similiar with the secondary ip)","commit_id":"7102d376e883e481c8ab2d0928257effc2ef53e1"},{"author":{"_account_id":17405,"name":"Jacob Gregor","email":"jgregor@us.ibm.com","username":"jgregor"},"change_message_id":"ebf49f688ff841a9362a8eaa311d774b3483c24c","unresolved":false,"context_lines":[{"line_number":2827,"context_line":"    def test_run_ssh_consistent_active_ip(self, mock_ssh_execute,"},{"line_number":2828,"context_line":"                                          mock_ssh_pool):"},{"line_number":2829,"context_line":"        # Make sure active_ip has same value in multiple success runs"},{"line_number":2830,"context_line":"        mock_ssh_execute.side_effect \u003d [paramiko.SSHException,"},{"line_number":2831,"context_line":"                                        mock.MagicMock()]"},{"line_number":2832,"context_line":"        ssh_cmd \u003d [\u0027svcinfo\u0027]"},{"line_number":2833,"context_line":"        self._driver._run_ssh(ssh_cmd)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba0121b8_66c1a9e4","line":2830,"in_reply_to":"ba0121b8_c0e22003","updated":"2016-03-29 20:44:59.000000000","message":"Yep, this is testing multiple successful runs. I thought to really test this out it would be better to fail SSHPool setup with the san_ip so that we may successfully setup using storwize_san_secondary_ip. Then once that all comes back ok, run again to make sure that the active_ip is still storwize_san_secondary_ip.","commit_id":"7102d376e883e481c8ab2d0928257effc2ef53e1"},{"author":{"_account_id":8912,"name":"Ryan McNair","email":"rdmcnair@us.ibm.com","username":"rdmcnair"},"change_message_id":"40c2086a654d9915167d2a231bc58a7f152ff8ac","unresolved":false,"context_lines":[{"line_number":2782,"context_line":"        mock_ssh_pool.side_effect \u003d ["},{"line_number":2783,"context_line":"            paramiko.SSHException,"},{"line_number":2784,"context_line":"            mock.MagicMock()]"},{"line_number":2785,"context_line":"        self._set_flag(\u0027storwize_san_secondary_ip\u0027, None)"},{"line_number":2786,"context_line":"        ssh_cmd \u003d [\u0027svcinfo\u0027]"},{"line_number":2787,"context_line":""},{"line_number":2788,"context_line":"        self.assertRaises(paramiko.SSHException,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a061dce_9dbb910e","line":2785,"updated":"2016-04-04 14:05:45.000000000","message":"Since we\u0027re setting secondary IP to None, we\u0027re not actually testing that both ips aren\u0027t reachable, we\u0027re testing that if secondary is not set and primary fails, that the exception bubbles up.  I think the test name is misleading...\n\nActually looking through this, this code appears to be the same as test_run_ssh_second_ip_not_set_failure which is a good name for this, so I think this test case should just be deleted.","commit_id":"effd6be5ea8ac79a9388f0aa39bc6ddb5fdfee07"},{"author":{"_account_id":17405,"name":"Jacob Gregor","email":"jgregor@us.ibm.com","username":"jgregor"},"change_message_id":"2c4b6121fc7f82ffcaa111b375f4042712b5b518","unresolved":false,"context_lines":[{"line_number":2782,"context_line":"        mock_ssh_pool.side_effect \u003d ["},{"line_number":2783,"context_line":"            paramiko.SSHException,"},{"line_number":2784,"context_line":"            mock.MagicMock()]"},{"line_number":2785,"context_line":"        self._set_flag(\u0027storwize_san_secondary_ip\u0027, None)"},{"line_number":2786,"context_line":"        ssh_cmd \u003d [\u0027svcinfo\u0027]"},{"line_number":2787,"context_line":""},{"line_number":2788,"context_line":"        self.assertRaises(paramiko.SSHException,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a061dce_c1907fef","line":2785,"in_reply_to":"9a061dce_9dbb910e","updated":"2016-04-04 16:42:16.000000000","message":"Good call.","commit_id":"effd6be5ea8ac79a9388f0aa39bc6ddb5fdfee07"},{"author":{"_account_id":8912,"name":"Ryan McNair","email":"rdmcnair@us.ibm.com","username":"rdmcnair"},"change_message_id":"40c2086a654d9915167d2a231bc58a7f152ff8ac","unresolved":false,"context_lines":[{"line_number":2816,"context_line":"    @mock.patch.object(random, \u0027randint\u0027, mock.Mock(return_value\u003d0))"},{"line_number":2817,"context_line":"    @mock.patch.object(ssh_utils, \u0027SSHPool\u0027)"},{"line_number":2818,"context_line":"    @mock.patch.object(processutils, \u0027ssh_execute\u0027)"},{"line_number":2819,"context_line":"    def test_run_ssh_consistent_active_ip(self, mock_ssh_execute,"},{"line_number":2820,"context_line":"                                          mock_ssh_pool):"},{"line_number":2821,"context_line":"        # Make sure active_ip has same value in multiple success runs"},{"line_number":2822,"context_line":"        mock_ssh_execute.side_effect \u003d [paramiko.SSHException,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a061dce_583747e3","line":2819,"updated":"2016-04-04 14:05:45.000000000","message":"Based on the name (and what coverage we\u0027re looking for) I\u0027d expect something more like http://paste.openstack.org/show/492879/","commit_id":"effd6be5ea8ac79a9388f0aa39bc6ddb5fdfee07"},{"author":{"_account_id":17405,"name":"Jacob Gregor","email":"jgregor@us.ibm.com","username":"jgregor"},"change_message_id":"2c4b6121fc7f82ffcaa111b375f4042712b5b518","unresolved":false,"context_lines":[{"line_number":2816,"context_line":"    @mock.patch.object(random, \u0027randint\u0027, mock.Mock(return_value\u003d0))"},{"line_number":2817,"context_line":"    @mock.patch.object(ssh_utils, \u0027SSHPool\u0027)"},{"line_number":2818,"context_line":"    @mock.patch.object(processutils, \u0027ssh_execute\u0027)"},{"line_number":2819,"context_line":"    def test_run_ssh_consistent_active_ip(self, mock_ssh_execute,"},{"line_number":2820,"context_line":"                                          mock_ssh_pool):"},{"line_number":2821,"context_line":"        # Make sure active_ip has same value in multiple success runs"},{"line_number":2822,"context_line":"        mock_ssh_execute.side_effect \u003d [paramiko.SSHException,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a061dce_37aa59d5","line":2819,"in_reply_to":"9a061dce_583747e3","updated":"2016-04-04 16:42:16.000000000","message":"Done","commit_id":"effd6be5ea8ac79a9388f0aa39bc6ddb5fdfee07"}],"cinder/volume/drivers/ibm/storwize_svc/storwize_svc_common.py":[{"author":{"_account_id":8912,"name":"Ryan McNair","email":"rdmcnair@us.ibm.com","username":"rdmcnair"},"change_message_id":"df39d0c7725bc94ce986ec59f477574f129bf39d","unresolved":false,"context_lines":[{"line_number":1866,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":1867,"context_line":"        super(StorwizeSVCCommonDriver, self).__init__(*args, **kwargs)"},{"line_number":1868,"context_line":"        self.configuration.append_config_values(storwize_svc_opts)"},{"line_number":1869,"context_line":"        self._backend_name \u003d self.configuration.safe_get(\u0027volume_backend_name\u0027)"},{"line_number":1870,"context_line":"        self.active_ip \u003d None"},{"line_number":1871,"context_line":"        self.inactive_ip \u003d None"},{"line_number":1872,"context_line":"        self._helpers \u003d StorwizeHelpers(self._run_ssh)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_92462a79","line":1869,"updated":"2016-03-18 16:50:31.000000000","message":"Shouldn\u0027t we set active_ip / inactive_ip on __init__? Seems like that\u0027s when we\u0027d also start out with the active_ip being the primary_ip and the inactive_ip being secondary_ip","commit_id":"283222f2079eb673bd44191657789d6c064eef05"},{"author":{"_account_id":17405,"name":"Jacob Gregor","email":"jgregor@us.ibm.com","username":"jgregor"},"change_message_id":"c51614f7bfdaaf973bb05ec537e26bacb420c6ad","unresolved":false,"context_lines":[{"line_number":1866,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":1867,"context_line":"        super(StorwizeSVCCommonDriver, self).__init__(*args, **kwargs)"},{"line_number":1868,"context_line":"        self.configuration.append_config_values(storwize_svc_opts)"},{"line_number":1869,"context_line":"        self._backend_name \u003d self.configuration.safe_get(\u0027volume_backend_name\u0027)"},{"line_number":1870,"context_line":"        self.active_ip \u003d None"},{"line_number":1871,"context_line":"        self.inactive_ip \u003d None"},{"line_number":1872,"context_line":"        self._helpers \u003d StorwizeHelpers(self._run_ssh)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_0d7c8171","line":1869,"in_reply_to":"1af94dfe_92462a79","updated":"2016-03-24 18:15:10.000000000","message":"Done","commit_id":"283222f2079eb673bd44191657789d6c064eef05"},{"author":{"_account_id":8912,"name":"Ryan McNair","email":"rdmcnair@us.ibm.com","username":"rdmcnair"},"change_message_id":"df39d0c7725bc94ce986ec59f477574f129bf39d","unresolved":false,"context_lines":[{"line_number":1996,"context_line":""},{"line_number":1997,"context_line":"    def _run_ssh(self, cmd_list, check_exit_code\u003dTrue, attempts\u003d1):"},{"line_number":1998,"context_line":"        cinder_utils.check_ssh_injection(cmd_list)"},{"line_number":1999,"context_line":"        command \u003d \u0027 \u0027.join(cmd_list)"},{"line_number":2000,"context_line":"        self.active_ip \u003d self.configuration.san_ip"},{"line_number":2001,"context_line":"        if not self.sshpool:"},{"line_number":2002,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_3d03a7b9","line":1999,"updated":"2016-03-18 16:50:31.000000000","message":"Don\u0027t think we want this here - it could set the active_ip incorrectly if we call _run_ssh when we\u0027ve already failed over and have self.sshpool configured with the secondary_ip. Then we\u0027d have active_ip set to san_ip but the active one is actually secondary_san_ip","commit_id":"283222f2079eb673bd44191657789d6c064eef05"},{"author":{"_account_id":17405,"name":"Jacob Gregor","email":"jgregor@us.ibm.com","username":"jgregor"},"change_message_id":"c51614f7bfdaaf973bb05ec537e26bacb420c6ad","unresolved":false,"context_lines":[{"line_number":1996,"context_line":""},{"line_number":1997,"context_line":"    def _run_ssh(self, cmd_list, check_exit_code\u003dTrue, attempts\u003d1):"},{"line_number":1998,"context_line":"        cinder_utils.check_ssh_injection(cmd_list)"},{"line_number":1999,"context_line":"        command \u003d \u0027 \u0027.join(cmd_list)"},{"line_number":2000,"context_line":"        self.active_ip \u003d self.configuration.san_ip"},{"line_number":2001,"context_line":"        if not self.sshpool:"},{"line_number":2002,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_ed802d49","line":1999,"in_reply_to":"1af94dfe_3d03a7b9","updated":"2016-03-24 18:15:10.000000000","message":"Good call.","commit_id":"283222f2079eb673bd44191657789d6c064eef05"},{"author":{"_account_id":8912,"name":"Ryan McNair","email":"rdmcnair@us.ibm.com","username":"rdmcnair"},"change_message_id":"df39d0c7725bc94ce986ec59f477574f129bf39d","unresolved":false,"context_lines":[{"line_number":2005,"context_line":"                LOG.warning(_LW(\u0027Unable to use san_ip to create SSHPool. Now \u0027"},{"line_number":2006,"context_line":"                                \u0027attempting to use storwize_san_secondary_ip \u0027"},{"line_number":2007,"context_line":"                                \u0027to create SSHPool.\u0027))"},{"line_number":2008,"context_line":"                if self._toggle_ip():"},{"line_number":2009,"context_line":"                    self.sshpool \u003d self._set_up_sshpool(self.active_ip)"},{"line_number":2010,"context_line":"                else:"},{"line_number":2011,"context_line":"                    LOG.warning(_LW(\u0027Unable to create SSHPool using san_ip \u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_5d0af38a","line":2008,"updated":"2016-03-18 16:50:31.000000000","message":"It may be clearer to move the logic of whether multi-IP is supported out of _toggle_ip.  That way the logic isn\u0027t pushed down so far.\n\nFor instance we could set in __init__\nis_multi_ip_supported \u003d self.configuration.storwize_san_secondary_ip !\u003d None\n\nThen we could change this if check to be \"if self.is_multi_ip_supported\", and if so, we automatically do the toggling","commit_id":"283222f2079eb673bd44191657789d6c064eef05"},{"author":{"_account_id":17405,"name":"Jacob Gregor","email":"jgregor@us.ibm.com","username":"jgregor"},"change_message_id":"c51614f7bfdaaf973bb05ec537e26bacb420c6ad","unresolved":false,"context_lines":[{"line_number":2005,"context_line":"                LOG.warning(_LW(\u0027Unable to use san_ip to create SSHPool. Now \u0027"},{"line_number":2006,"context_line":"                                \u0027attempting to use storwize_san_secondary_ip \u0027"},{"line_number":2007,"context_line":"                                \u0027to create SSHPool.\u0027))"},{"line_number":2008,"context_line":"                if self._toggle_ip():"},{"line_number":2009,"context_line":"                    self.sshpool \u003d self._set_up_sshpool(self.active_ip)"},{"line_number":2010,"context_line":"                else:"},{"line_number":2011,"context_line":"                    LOG.warning(_LW(\u0027Unable to create SSHPool using san_ip \u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_2d9345a5","line":2008,"in_reply_to":"1af94dfe_5d0af38a","updated":"2016-03-24 18:15:10.000000000","message":"I think it would be better to do something like this in a follow up patch.","commit_id":"283222f2079eb673bd44191657789d6c064eef05"},{"author":{"_account_id":8912,"name":"Ryan McNair","email":"rdmcnair@us.ibm.com","username":"rdmcnair"},"change_message_id":"df39d0c7725bc94ce986ec59f477574f129bf39d","unresolved":false,"context_lines":[{"line_number":2090,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":2091,"context_line":"                LOG.error(_LE(\"Error running SSH command: %s\"), command)"},{"line_number":2092,"context_line":""},{"line_number":2093,"context_line":"    def _toggle_ip(self):"},{"line_number":2094,"context_line":"        # Change active_ip if storwize_san_secondary_ip is set."},{"line_number":2095,"context_line":"        if self.configuration.storwize_san_secondary_ip is None:"},{"line_number":2096,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":1,"id":"1af94dfe_3d4e07c1","line":2093,"updated":"2016-03-18 16:50:31.000000000","message":"With above suggestion, this would just become a simple swap method between active_ip and inactive_ip and do something along the lines of:\n\ntmp \u003d self.active_ip\nself.active_ip \u003d self.inactive_ip\nself.inactive_ip \u003d tmp","commit_id":"283222f2079eb673bd44191657789d6c064eef05"},{"author":{"_account_id":20140,"name":"Karthik Prabhu Vinod","email":"karthik.prabhu.vinod@intel.com","username":"kprabhuv"},"change_message_id":"b74d2c957aaa367f7e5323956b40d08bfd7c1674","unresolved":false,"context_lines":[{"line_number":1995,"context_line":"        LOG.debug(\u0027leave: check_for_setup_error\u0027)"},{"line_number":1996,"context_line":""},{"line_number":1997,"context_line":"    def _run_ssh(self, cmd_list, check_exit_code\u003dTrue, attempts\u003d1):"},{"line_number":1998,"context_line":"        cinder_utils.check_ssh_injection(cmd_list)"},{"line_number":1999,"context_line":"        command \u003d \u0027 \u0027.join(cmd_list)"},{"line_number":2000,"context_line":"        if not self.sshpool:"},{"line_number":2001,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba0121b8_dc2abd8f","line":1998,"range":{"start_line":1998,"start_character":0,"end_line":1998,"end_character":8},"updated":"2016-03-30 16:09:05.000000000","message":"Hi I would suggest that it would be nice to refactor run_ssh into two methods as below;\n1.) _set_ssh_pool\n2.) _set_sshh_execute\nIt would improve the readability.\n\nhttp://paste.openstack.org/show/491347/","commit_id":"7102d376e883e481c8ab2d0928257effc2ef53e1"},{"author":{"_account_id":17405,"name":"Jacob Gregor","email":"jgregor@us.ibm.com","username":"jgregor"},"change_message_id":"df5d06306b472d37a56e6c299eedfdbc85b501e5","unresolved":false,"context_lines":[{"line_number":1995,"context_line":"        LOG.debug(\u0027leave: check_for_setup_error\u0027)"},{"line_number":1996,"context_line":""},{"line_number":1997,"context_line":"    def _run_ssh(self, cmd_list, check_exit_code\u003dTrue, attempts\u003d1):"},{"line_number":1998,"context_line":"        cinder_utils.check_ssh_injection(cmd_list)"},{"line_number":1999,"context_line":"        command \u003d \u0027 \u0027.join(cmd_list)"},{"line_number":2000,"context_line":"        if not self.sshpool:"},{"line_number":2001,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba0121b8_dd390dd9","line":1998,"range":{"start_line":1998,"start_character":0,"end_line":1998,"end_character":8},"in_reply_to":"ba0121b8_dc2abd8f","updated":"2016-03-30 20:39:47.000000000","message":"Good suggestion! Since there is gonna be some refactor done in the near future, I will probably address this suggestion then.","commit_id":"7102d376e883e481c8ab2d0928257effc2ef53e1"},{"author":{"_account_id":8912,"name":"Ryan McNair","email":"rdmcnair@us.ibm.com","username":"rdmcnair"},"change_message_id":"851e85e16076f29d90aa560248825b5a318d70e6","unresolved":false,"context_lines":[{"line_number":2093,"context_line":"        # Change active_ip if storwize_san_secondary_ip is set."},{"line_number":2094,"context_line":"        if self.configuration.storwize_san_secondary_ip is None:"},{"line_number":2095,"context_line":"            return False"},{"line_number":2096,"context_line":"        self.inactive_ip \u003d self.active_ip"},{"line_number":2097,"context_line":"        if self.active_ip \u003d\u003d self.configuration.san_ip:"},{"line_number":2098,"context_line":"            self.active_ip \u003d self.configuration.storwize_san_secondary_ip"},{"line_number":2099,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba0121b8_e0cac4a0","line":2096,"updated":"2016-03-29 14:18:38.000000000","message":"Since we\u0027re just swapping the inactive_ip with active_ip, IMO it\u0027s easier to follow as an outside observer if we do below since it\u0027s a common pattern for swapping values:\ntmp \u003d self.inactive_ip\nself.inactive_ip \u003d self.active_ip\nself.active_ip \u003d tmp","commit_id":"7102d376e883e481c8ab2d0928257effc2ef53e1"},{"author":{"_account_id":17405,"name":"Jacob Gregor","email":"jgregor@us.ibm.com","username":"jgregor"},"change_message_id":"df5d06306b472d37a56e6c299eedfdbc85b501e5","unresolved":false,"context_lines":[{"line_number":2093,"context_line":"        # Change active_ip if storwize_san_secondary_ip is set."},{"line_number":2094,"context_line":"        if self.configuration.storwize_san_secondary_ip is None:"},{"line_number":2095,"context_line":"            return False"},{"line_number":2096,"context_line":"        self.inactive_ip \u003d self.active_ip"},{"line_number":2097,"context_line":"        if self.active_ip \u003d\u003d self.configuration.san_ip:"},{"line_number":2098,"context_line":"            self.active_ip \u003d self.configuration.storwize_san_secondary_ip"},{"line_number":2099,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba0121b8_9a479b76","line":2096,"in_reply_to":"ba0121b8_c0c4cb60","updated":"2016-03-30 20:39:47.000000000","message":"Done","commit_id":"7102d376e883e481c8ab2d0928257effc2ef53e1"},{"author":{"_account_id":17405,"name":"Jacob Gregor","email":"jgregor@us.ibm.com","username":"jgregor"},"change_message_id":"ebf49f688ff841a9362a8eaa311d774b3483c24c","unresolved":false,"context_lines":[{"line_number":2093,"context_line":"        # Change active_ip if storwize_san_secondary_ip is set."},{"line_number":2094,"context_line":"        if self.configuration.storwize_san_secondary_ip is None:"},{"line_number":2095,"context_line":"            return False"},{"line_number":2096,"context_line":"        self.inactive_ip \u003d self.active_ip"},{"line_number":2097,"context_line":"        if self.active_ip \u003d\u003d self.configuration.san_ip:"},{"line_number":2098,"context_line":"            self.active_ip \u003d self.configuration.storwize_san_secondary_ip"},{"line_number":2099,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba0121b8_c0c4cb60","line":2096,"in_reply_to":"ba0121b8_e0cac4a0","updated":"2016-03-29 20:44:59.000000000","message":"Sure I can do that in the next patch set.","commit_id":"7102d376e883e481c8ab2d0928257effc2ef53e1"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"0047659b750ab3c8229fe8f0b412d218eef63f46","unresolved":false,"context_lines":[{"line_number":2035,"context_line":"                                    \u0027not configured.\u0027))"},{"line_number":2036,"context_line":"                    raise"},{"line_number":2037,"context_line":"            except Exception:"},{"line_number":2038,"context_line":"                LOG.warning(_LW(\u0027Unable to execute SSH command. \u0027))"},{"line_number":2039,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":2040,"context_line":"                    LOG.error(_LE(\"Error running SSH command: %s\"),"},{"line_number":2041,"context_line":"                              command)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a061dce_450d643d","line":2038,"updated":"2016-04-05 14:37:06.000000000","message":"You can remove this line, since the LOG.error below will print basically the same message.","commit_id":"4bd48486901be8af6fbad6544df3e47de9886265"},{"author":{"_account_id":17405,"name":"Jacob Gregor","email":"jgregor@us.ibm.com","username":"jgregor"},"change_message_id":"308be7282df748b22111ccf1cd72bc5884fd796b","unresolved":false,"context_lines":[{"line_number":2035,"context_line":"                                    \u0027not configured.\u0027))"},{"line_number":2036,"context_line":"                    raise"},{"line_number":2037,"context_line":"            except Exception:"},{"line_number":2038,"context_line":"                LOG.warning(_LW(\u0027Unable to execute SSH command. \u0027))"},{"line_number":2039,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":2040,"context_line":"                    LOG.error(_LE(\"Error running SSH command: %s\"),"},{"line_number":2041,"context_line":"                              command)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a061dce_5a3d3aba","line":2038,"in_reply_to":"9a061dce_450d643d","updated":"2016-04-05 15:14:10.000000000","message":"Done","commit_id":"4bd48486901be8af6fbad6544df3e47de9886265"},{"author":{"_account_id":8912,"name":"Ryan McNair","email":"rdmcnair@us.ibm.com","username":"rdmcnair"},"change_message_id":"701f9345c29be87cf89f617b48e093b9c17510bf","unresolved":false,"context_lines":[{"line_number":2021,"context_line":"            # before raising an error."},{"line_number":2022,"context_line":"            try:"},{"line_number":2023,"context_line":"                if self._toggle_ip():"},{"line_number":2024,"context_line":"                    LOG.warning(_LW(\"Unable to execute SSH command with \""},{"line_number":2025,"context_line":"                                    \"%(inactive)s. Attempting to switch IP \""},{"line_number":2026,"context_line":"                                    \"to %(active)s.\"),"},{"line_number":2027,"context_line":"                                {\u0027inactive\u0027: self.inactive_ip,"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a061dce_1fac4c9f","line":2024,"updated":"2016-04-05 17:01:40.000000000","message":"Sorry just noticing this now, but it seems a bit odd to log that we\u0027re attempting to switch after we\u0027ve already actually switched (in _toggle_ip).  Also _toggle_ip will already log that it\u0027s flipping the IPs.\n\nIt may make sense to slide up the warning above 2023 and warn that we were unable to execute the ssh command and that we\u0027ll try switching the IPs. Then we could just have the additional warning if we can\u0027t actually toggle_ip (though I\u0027m not positive we need to warn this if no secondary_ip was set).\n\nI don\u0027t want to hold this up to get what I think is better logging (since I\u0027m no good with words and maybe it\u0027s not better), but if you agree it would be worth trying to update.","commit_id":"286556c3b21d05eb6edc22c78f280d47c32891cb"},{"author":{"_account_id":17405,"name":"Jacob Gregor","email":"jgregor@us.ibm.com","username":"jgregor"},"change_message_id":"307688dfab7dc692e1f747bedf90bcd837639d83","unresolved":false,"context_lines":[{"line_number":2021,"context_line":"            # before raising an error."},{"line_number":2022,"context_line":"            try:"},{"line_number":2023,"context_line":"                if self._toggle_ip():"},{"line_number":2024,"context_line":"                    LOG.warning(_LW(\"Unable to execute SSH command with \""},{"line_number":2025,"context_line":"                                    \"%(inactive)s. Attempting to switch IP \""},{"line_number":2026,"context_line":"                                    \"to %(active)s.\"),"},{"line_number":2027,"context_line":"                                {\u0027inactive\u0027: self.inactive_ip,"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a061dce_c5147d4e","line":2024,"in_reply_to":"9a061dce_1fac4c9f","updated":"2016-04-06 21:41:04.000000000","message":"I updated the message so that it makes more sense for where it is at in the code.","commit_id":"286556c3b21d05eb6edc22c78f280d47c32891cb"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"f92bcd608dfc4cd7f70e2bdda069abf55a5d83ed","unresolved":false,"context_lines":[{"line_number":1997,"context_line":"    def _run_ssh(self, cmd_list, check_exit_code\u003dTrue, attempts\u003d1):"},{"line_number":1998,"context_line":"        cinder_utils.check_ssh_injection(cmd_list)"},{"line_number":1999,"context_line":"        command \u003d \u0027 \u0027.join(cmd_list)"},{"line_number":2000,"context_line":"        if not self.sshpool:"},{"line_number":2001,"context_line":"            try:"},{"line_number":2002,"context_line":"                self.sshpool \u003d self._set_up_sshpool(self.active_ip)"},{"line_number":2003,"context_line":"            except paramiko.SSHException:"},{"line_number":2004,"context_line":"                LOG.warning(_LW(\u0027Unable to use san_ip to create SSHPool. Now \u0027"},{"line_number":2005,"context_line":"                                \u0027attempting to use storwize_san_secondary_ip \u0027"},{"line_number":2006,"context_line":"                                \u0027to create SSHPool.\u0027))"},{"line_number":2007,"context_line":"                if self._toggle_ip():"},{"line_number":2008,"context_line":"                    self.sshpool \u003d self._set_up_sshpool(self.active_ip)"},{"line_number":2009,"context_line":"                else:"},{"line_number":2010,"context_line":"                    LOG.warning(_LW(\u0027Unable to create SSHPool using san_ip \u0027"},{"line_number":2011,"context_line":"                                    \u0027and not able to use \u0027"},{"line_number":2012,"context_line":"                                    \u0027storwize_san_secondary_ip since it is \u0027"},{"line_number":2013,"context_line":"                                    \u0027not configured.\u0027))"},{"line_number":2014,"context_line":"                    raise"},{"line_number":2015,"context_line":"        try:"},{"line_number":2016,"context_line":"            return self._ssh_execute(self.sshpool, command,"},{"line_number":2017,"context_line":"                                     check_exit_code, attempts)"},{"line_number":2018,"context_line":""},{"line_number":2019,"context_line":"        except Exception:"},{"line_number":2020,"context_line":"            # Need to check if creating an SSHPool storwize_san_secondary_ip"},{"line_number":2021,"context_line":"            # before raising an error."},{"line_number":2022,"context_line":"            try:"},{"line_number":2023,"context_line":"                if self._toggle_ip():"},{"line_number":2024,"context_line":"                    LOG.warning(_LW(\"Unable to execute SSH command with \""},{"line_number":2025,"context_line":"                                    \"%(inactive)s. Attempting to switch IP \""},{"line_number":2026,"context_line":"                                    \"to %(active)s.\"),"},{"line_number":2027,"context_line":"                                {\u0027inactive\u0027: self.inactive_ip,"},{"line_number":2028,"context_line":"                                 \u0027active\u0027: self.active_ip})"},{"line_number":2029,"context_line":"                    self.sshpool \u003d self._set_up_sshpool(self.active_ip)"},{"line_number":2030,"context_line":"                    return self._ssh_execute(self.sshpool, command,"},{"line_number":2031,"context_line":"                                             check_exit_code, attempts)"},{"line_number":2032,"context_line":"                else:"},{"line_number":2033,"context_line":"                    LOG.warning(_LW(\u0027Not able to use \u0027"},{"line_number":2034,"context_line":"                                    \u0027storwize_san_secondary_ip since it is \u0027"},{"line_number":2035,"context_line":"                                    \u0027not configured.\u0027))"},{"line_number":2036,"context_line":"                    raise"},{"line_number":2037,"context_line":"            except Exception:"},{"line_number":2038,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":2039,"context_line":"                    LOG.error(_LE(\"Error running SSH command: %s\"),"},{"line_number":2040,"context_line":"                              command)"},{"line_number":2041,"context_line":""},{"line_number":2042,"context_line":"    def _set_up_sshpool(self, ip):"},{"line_number":2043,"context_line":"        password \u003d self.configuration.san_password"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a061dce_d3cbe3a3","line":2040,"range":{"start_line":2000,"start_character":8,"end_line":2040,"end_character":38},"updated":"2016-04-05 22:11:21.000000000","message":"I think it could be simplified like this to avoid code duplication:\n\nips \u003d filter(None, (\u0027default\u0027, self.configuration.san_ip, self.configuration.storwize_san_secondary_ip))\nfor ip in ips:\n    if not self.sshpool:\n        continue\n    try:\n        if ip !\u003d \u0027default\u0027:\n            self.sshpool \u003d self._set_up_sshpool(ip)\n        return self._ssh_execute(self.sshpool, command, check_exit_code, attempts)\n    except paramiko.SSHException:\n        LOG.warning(_LW(\u0027Unable to use create SSHPool using following ip: %s.\u0027), ip)\n    except Exception:\n        LOG.error(_LE(\u0027Error running SSH command: %s\u0027), command)\nelse:\n    raise","commit_id":"286556c3b21d05eb6edc22c78f280d47c32891cb"},{"author":{"_account_id":17405,"name":"Jacob Gregor","email":"jgregor@us.ibm.com","username":"jgregor"},"change_message_id":"7405c40a1dcbe0296bba240fd6ed4ccf866ea257","unresolved":false,"context_lines":[{"line_number":1997,"context_line":"    def _run_ssh(self, cmd_list, check_exit_code\u003dTrue, attempts\u003d1):"},{"line_number":1998,"context_line":"        cinder_utils.check_ssh_injection(cmd_list)"},{"line_number":1999,"context_line":"        command \u003d \u0027 \u0027.join(cmd_list)"},{"line_number":2000,"context_line":"        if not self.sshpool:"},{"line_number":2001,"context_line":"            try:"},{"line_number":2002,"context_line":"                self.sshpool \u003d self._set_up_sshpool(self.active_ip)"},{"line_number":2003,"context_line":"            except paramiko.SSHException:"},{"line_number":2004,"context_line":"                LOG.warning(_LW(\u0027Unable to use san_ip to create SSHPool. Now \u0027"},{"line_number":2005,"context_line":"                                \u0027attempting to use storwize_san_secondary_ip \u0027"},{"line_number":2006,"context_line":"                                \u0027to create SSHPool.\u0027))"},{"line_number":2007,"context_line":"                if self._toggle_ip():"},{"line_number":2008,"context_line":"                    self.sshpool \u003d self._set_up_sshpool(self.active_ip)"},{"line_number":2009,"context_line":"                else:"},{"line_number":2010,"context_line":"                    LOG.warning(_LW(\u0027Unable to create SSHPool using san_ip \u0027"},{"line_number":2011,"context_line":"                                    \u0027and not able to use \u0027"},{"line_number":2012,"context_line":"                                    \u0027storwize_san_secondary_ip since it is \u0027"},{"line_number":2013,"context_line":"                                    \u0027not configured.\u0027))"},{"line_number":2014,"context_line":"                    raise"},{"line_number":2015,"context_line":"        try:"},{"line_number":2016,"context_line":"            return self._ssh_execute(self.sshpool, command,"},{"line_number":2017,"context_line":"                                     check_exit_code, attempts)"},{"line_number":2018,"context_line":""},{"line_number":2019,"context_line":"        except Exception:"},{"line_number":2020,"context_line":"            # Need to check if creating an SSHPool storwize_san_secondary_ip"},{"line_number":2021,"context_line":"            # before raising an error."},{"line_number":2022,"context_line":"            try:"},{"line_number":2023,"context_line":"                if self._toggle_ip():"},{"line_number":2024,"context_line":"                    LOG.warning(_LW(\"Unable to execute SSH command with \""},{"line_number":2025,"context_line":"                                    \"%(inactive)s. Attempting to switch IP \""},{"line_number":2026,"context_line":"                                    \"to %(active)s.\"),"},{"line_number":2027,"context_line":"                                {\u0027inactive\u0027: self.inactive_ip,"},{"line_number":2028,"context_line":"                                 \u0027active\u0027: self.active_ip})"},{"line_number":2029,"context_line":"                    self.sshpool \u003d self._set_up_sshpool(self.active_ip)"},{"line_number":2030,"context_line":"                    return self._ssh_execute(self.sshpool, command,"},{"line_number":2031,"context_line":"                                             check_exit_code, attempts)"},{"line_number":2032,"context_line":"                else:"},{"line_number":2033,"context_line":"                    LOG.warning(_LW(\u0027Not able to use \u0027"},{"line_number":2034,"context_line":"                                    \u0027storwize_san_secondary_ip since it is \u0027"},{"line_number":2035,"context_line":"                                    \u0027not configured.\u0027))"},{"line_number":2036,"context_line":"                    raise"},{"line_number":2037,"context_line":"            except Exception:"},{"line_number":2038,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":2039,"context_line":"                    LOG.error(_LE(\"Error running SSH command: %s\"),"},{"line_number":2040,"context_line":"                              command)"},{"line_number":2041,"context_line":""},{"line_number":2042,"context_line":"    def _set_up_sshpool(self, ip):"},{"line_number":2043,"context_line":"        password \u003d self.configuration.san_password"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a061dce_ebe482ad","line":2040,"range":{"start_line":2000,"start_character":8,"end_line":2040,"end_character":38},"in_reply_to":"9a061dce_c53d9dde","updated":"2016-04-08 15:11:57.000000000","message":"Since there will be a follow up patch that will do some general refactor work to remove duplicate code and improve efficiency, I think it would be better to address this comment in that patch.","commit_id":"286556c3b21d05eb6edc22c78f280d47c32891cb"},{"author":{"_account_id":17405,"name":"Jacob Gregor","email":"jgregor@us.ibm.com","username":"jgregor"},"change_message_id":"307688dfab7dc692e1f747bedf90bcd837639d83","unresolved":false,"context_lines":[{"line_number":1997,"context_line":"    def _run_ssh(self, cmd_list, check_exit_code\u003dTrue, attempts\u003d1):"},{"line_number":1998,"context_line":"        cinder_utils.check_ssh_injection(cmd_list)"},{"line_number":1999,"context_line":"        command \u003d \u0027 \u0027.join(cmd_list)"},{"line_number":2000,"context_line":"        if not self.sshpool:"},{"line_number":2001,"context_line":"            try:"},{"line_number":2002,"context_line":"                self.sshpool \u003d self._set_up_sshpool(self.active_ip)"},{"line_number":2003,"context_line":"            except paramiko.SSHException:"},{"line_number":2004,"context_line":"                LOG.warning(_LW(\u0027Unable to use san_ip to create SSHPool. Now \u0027"},{"line_number":2005,"context_line":"                                \u0027attempting to use storwize_san_secondary_ip \u0027"},{"line_number":2006,"context_line":"                                \u0027to create SSHPool.\u0027))"},{"line_number":2007,"context_line":"                if self._toggle_ip():"},{"line_number":2008,"context_line":"                    self.sshpool \u003d self._set_up_sshpool(self.active_ip)"},{"line_number":2009,"context_line":"                else:"},{"line_number":2010,"context_line":"                    LOG.warning(_LW(\u0027Unable to create SSHPool using san_ip \u0027"},{"line_number":2011,"context_line":"                                    \u0027and not able to use \u0027"},{"line_number":2012,"context_line":"                                    \u0027storwize_san_secondary_ip since it is \u0027"},{"line_number":2013,"context_line":"                                    \u0027not configured.\u0027))"},{"line_number":2014,"context_line":"                    raise"},{"line_number":2015,"context_line":"        try:"},{"line_number":2016,"context_line":"            return self._ssh_execute(self.sshpool, command,"},{"line_number":2017,"context_line":"                                     check_exit_code, attempts)"},{"line_number":2018,"context_line":""},{"line_number":2019,"context_line":"        except Exception:"},{"line_number":2020,"context_line":"            # Need to check if creating an SSHPool storwize_san_secondary_ip"},{"line_number":2021,"context_line":"            # before raising an error."},{"line_number":2022,"context_line":"            try:"},{"line_number":2023,"context_line":"                if self._toggle_ip():"},{"line_number":2024,"context_line":"                    LOG.warning(_LW(\"Unable to execute SSH command with \""},{"line_number":2025,"context_line":"                                    \"%(inactive)s. Attempting to switch IP \""},{"line_number":2026,"context_line":"                                    \"to %(active)s.\"),"},{"line_number":2027,"context_line":"                                {\u0027inactive\u0027: self.inactive_ip,"},{"line_number":2028,"context_line":"                                 \u0027active\u0027: self.active_ip})"},{"line_number":2029,"context_line":"                    self.sshpool \u003d self._set_up_sshpool(self.active_ip)"},{"line_number":2030,"context_line":"                    return self._ssh_execute(self.sshpool, command,"},{"line_number":2031,"context_line":"                                             check_exit_code, attempts)"},{"line_number":2032,"context_line":"                else:"},{"line_number":2033,"context_line":"                    LOG.warning(_LW(\u0027Not able to use \u0027"},{"line_number":2034,"context_line":"                                    \u0027storwize_san_secondary_ip since it is \u0027"},{"line_number":2035,"context_line":"                                    \u0027not configured.\u0027))"},{"line_number":2036,"context_line":"                    raise"},{"line_number":2037,"context_line":"            except Exception:"},{"line_number":2038,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":2039,"context_line":"                    LOG.error(_LE(\"Error running SSH command: %s\"),"},{"line_number":2040,"context_line":"                              command)"},{"line_number":2041,"context_line":""},{"line_number":2042,"context_line":"    def _set_up_sshpool(self, ip):"},{"line_number":2043,"context_line":"        password \u003d self.configuration.san_password"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a061dce_c53d9dde","line":2040,"range":{"start_line":2000,"start_character":8,"end_line":2040,"end_character":38},"in_reply_to":"9a061dce_d3cbe3a3","updated":"2016-04-06 21:41:04.000000000","message":"I missed this comment in my last patch update, but will look into it for the next patch set","commit_id":"286556c3b21d05eb6edc22c78f280d47c32891cb"},{"author":{"_account_id":12825,"name":"Szymon Wróblewski","email":"szymon.wroblewski@ovhcloud.com","username":"bluex"},"change_message_id":"f92bcd608dfc4cd7f70e2bdda069abf55a5d83ed","unresolved":false,"context_lines":[{"line_number":2093,"context_line":"        if self.configuration.storwize_san_secondary_ip is None:"},{"line_number":2094,"context_line":"            return False"},{"line_number":2095,"context_line":""},{"line_number":2096,"context_line":"        tmp \u003d self.inactive_ip"},{"line_number":2097,"context_line":"        self.inactive_ip \u003d self.active_ip"},{"line_number":2098,"context_line":"        self.active_ip \u003d tmp"},{"line_number":2099,"context_line":"        LOG.info(_LI(\u0027Toggle active_ip from %(old)s to \u0027"},{"line_number":2100,"context_line":"                     \u0027%(new)s.\u0027),"},{"line_number":2101,"context_line":"                 {\u0027old\u0027: self.inactive_ip,"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a061dce_da9f784e","line":2098,"range":{"start_line":2096,"start_character":8,"end_line":2098,"end_character":28},"updated":"2016-04-05 22:11:21.000000000","message":"Make it more Pythonic :)\n\nself.inactive_ip, self.active_ip \u003d self.active_ip, self.inactive_ip","commit_id":"286556c3b21d05eb6edc22c78f280d47c32891cb"},{"author":{"_account_id":17405,"name":"Jacob Gregor","email":"jgregor@us.ibm.com","username":"jgregor"},"change_message_id":"7405c40a1dcbe0296bba240fd6ed4ccf866ea257","unresolved":false,"context_lines":[{"line_number":2093,"context_line":"        if self.configuration.storwize_san_secondary_ip is None:"},{"line_number":2094,"context_line":"            return False"},{"line_number":2095,"context_line":""},{"line_number":2096,"context_line":"        tmp \u003d self.inactive_ip"},{"line_number":2097,"context_line":"        self.inactive_ip \u003d self.active_ip"},{"line_number":2098,"context_line":"        self.active_ip \u003d tmp"},{"line_number":2099,"context_line":"        LOG.info(_LI(\u0027Toggle active_ip from %(old)s to \u0027"},{"line_number":2100,"context_line":"                     \u0027%(new)s.\u0027),"},{"line_number":2101,"context_line":"                 {\u0027old\u0027: self.inactive_ip,"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a061dce_cbd7feeb","line":2098,"range":{"start_line":2096,"start_character":8,"end_line":2098,"end_character":28},"in_reply_to":"9a061dce_652db1a7","updated":"2016-04-08 15:11:57.000000000","message":"Done","commit_id":"286556c3b21d05eb6edc22c78f280d47c32891cb"},{"author":{"_account_id":17405,"name":"Jacob Gregor","email":"jgregor@us.ibm.com","username":"jgregor"},"change_message_id":"307688dfab7dc692e1f747bedf90bcd837639d83","unresolved":false,"context_lines":[{"line_number":2093,"context_line":"        if self.configuration.storwize_san_secondary_ip is None:"},{"line_number":2094,"context_line":"            return False"},{"line_number":2095,"context_line":""},{"line_number":2096,"context_line":"        tmp \u003d self.inactive_ip"},{"line_number":2097,"context_line":"        self.inactive_ip \u003d self.active_ip"},{"line_number":2098,"context_line":"        self.active_ip \u003d tmp"},{"line_number":2099,"context_line":"        LOG.info(_LI(\u0027Toggle active_ip from %(old)s to \u0027"},{"line_number":2100,"context_line":"                     \u0027%(new)s.\u0027),"},{"line_number":2101,"context_line":"                 {\u0027old\u0027: self.inactive_ip,"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a061dce_652db1a7","line":2098,"range":{"start_line":2096,"start_character":8,"end_line":2098,"end_character":28},"in_reply_to":"9a061dce_da9f784e","updated":"2016-04-06 21:41:04.000000000","message":"Same as above.","commit_id":"286556c3b21d05eb6edc22c78f280d47c32891cb"}]}
