)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"f47c71e43d33862878344920b24891bd6a85b066","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Juergen Brendel \u003cjbrendel@cisco.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-08-06 05:53:02 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Incorporating Henry\u0027s review feedback.."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: I09d81b424d86f4cd35ca048507f06471246b91d8"},{"line_number":10,"context_line":"Closes-Bug: 1352635"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"baada198_699bb164","line":7,"updated":"2014-08-06 05:59:58.000000000","message":"please improve the comment message so we can tell what this commit is about.","commit_id":"323cc6d6d27209e9e1eab003d2464656abb3a475"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"c9d08d647b8094975d9edc986820e131da9fd0d9","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Juergen Brendel \u003cjbrendel@cisco.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-08-06 05:53:02 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Incorporating Henry\u0027s review feedback.."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: I09d81b424d86f4cd35ca048507f06471246b91d8"},{"line_number":10,"context_line":"Closes-Bug: 1352635"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"baada198_f426b166","line":7,"in_reply_to":"baada198_699bb164","updated":"2014-08-06 07:56:58.000000000","message":"+1","commit_id":"323cc6d6d27209e9e1eab003d2464656abb3a475"}],"neutron/plugins/ml2/drivers/cisco/nexus/nexus_network_driver.py":[{"author":{"_account_id":1923,"name":"Mohammad Banikazemi","email":"mbanikazemi@gmail.com","username":"mb-s"},"change_message_id":"39e1511fc45e3c54c9d22a8eedda45e0b91e6f33","unresolved":false,"context_lines":[{"line_number":95,"context_line":"        except TypeError as e:"},{"line_number":96,"context_line":"            # ... but if that causes an error, we appear to have the old ncclient"},{"line_number":97,"context_line":"            # installed, which doesn\u0027t understand this parameter."},{"line_number":98,"context_line":"            man \u003d self.ncclient.connect(host\u003dnexus_host,"},{"line_number":99,"context_line":"                                        port\u003dnexus_ssh_port,"},{"line_number":100,"context_line":"                                        username\u003dnexus_user,"},{"line_number":101,"context_line":"                                        password\u003dnexus_password)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_7dbfefab","line":98,"updated":"2014-08-06 02:14:09.000000000","message":"What if this raises exception as coded for in the original code. Don\u0027t you want to catch it?","commit_id":"b8abf824e805f907bc1e1b1fde32cad4c2b595b1"},{"author":{"_account_id":490,"name":"Sumit Naiksatam","email":"sumitnaiksatam@gmail.com","username":"snaiksat"},"change_message_id":"1da22fc9510af115e8c8c8a785293b85cd505f6b","unresolved":false,"context_lines":[{"line_number":95,"context_line":"        except TypeError as e:"},{"line_number":96,"context_line":"            # ... but if that causes an error, we appear to have the old ncclient"},{"line_number":97,"context_line":"            # installed, which doesn\u0027t understand this parameter."},{"line_number":98,"context_line":"            man \u003d self.ncclient.connect(host\u003dnexus_host,"},{"line_number":99,"context_line":"                                        port\u003dnexus_ssh_port,"},{"line_number":100,"context_line":"                                        username\u003dnexus_user,"},{"line_number":101,"context_line":"                                        password\u003dnexus_password)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_c8903bf6","line":98,"in_reply_to":"baada198_7dbfefab","updated":"2014-08-06 03:18:12.000000000","message":"I think lines 89 to 100 should be a separate try except block, preserving the old try except block. Probably thats what you intended to do.","commit_id":"b8abf824e805f907bc1e1b1fde32cad4c2b595b1"},{"author":{"_account_id":6139,"name":"Juergen Brendel","email":"jbrendel@cisco.com","username":"jbrendel"},"change_message_id":"f430c8128dc66d018f771438ece23ce080d198bd","unresolved":false,"context_lines":[{"line_number":95,"context_line":"        except TypeError as e:"},{"line_number":96,"context_line":"            # ... but if that causes an error, we appear to have the old ncclient"},{"line_number":97,"context_line":"            # installed, which doesn\u0027t understand this parameter."},{"line_number":98,"context_line":"            man \u003d self.ncclient.connect(host\u003dnexus_host,"},{"line_number":99,"context_line":"                                        port\u003dnexus_ssh_port,"},{"line_number":100,"context_line":"                                        username\u003dnexus_user,"},{"line_number":101,"context_line":"                                        password\u003dnexus_password)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_8e5d6b19","line":98,"in_reply_to":"baada198_7dbfefab","updated":"2014-08-06 04:51:16.000000000","message":"If another exception is thrown then the second except (line 102) will catch it. That\u0027s the original except- clause right there. So, I do some special exception handling just for TypeError, every other exception is handled just like before.","commit_id":"b8abf824e805f907bc1e1b1fde32cad4c2b595b1"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"3168ba2b77b83a2a6a678142a3f727498e7d65b4","unresolved":false,"context_lines":[{"line_number":95,"context_line":"        except TypeError as e:"},{"line_number":96,"context_line":"            # ... but if that causes an error, we appear to have the old ncclient"},{"line_number":97,"context_line":"            # installed, which doesn\u0027t understand this parameter."},{"line_number":98,"context_line":"            man \u003d self.ncclient.connect(host\u003dnexus_host,"},{"line_number":99,"context_line":"                                        port\u003dnexus_ssh_port,"},{"line_number":100,"context_line":"                                        username\u003dnexus_user,"},{"line_number":101,"context_line":"                                        password\u003dnexus_password)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_a08eac78","line":98,"in_reply_to":"baada198_8e5d6b19","updated":"2014-08-06 13:13:56.000000000","message":"I disagree. The try from line 88 will not catch an exception raised here.\n\n    \u003e\u003e\u003e def foo():\n            try:\n                raise KeyError\n            except KeyError:\n                raise ValueError\n            except Exception:\n                raise AttributeError\n\n    \u003e\u003e\u003e foo()\n\n    Traceback (most recent call last):\n      File \"\u003cpyshell#28\u003e\", line 1, in \u003cmodule\u003e\n        foo()\n      File \"\u003cpyshell#27\u003e\", line 5, in foo\n        raise ValueError\n    ValueError\n    \u003e\u003e\u003e","commit_id":"b8abf824e805f907bc1e1b1fde32cad4c2b595b1"},{"author":{"_account_id":6139,"name":"Juergen Brendel","email":"jbrendel@cisco.com","username":"jbrendel"},"change_message_id":"f430c8128dc66d018f771438ece23ce080d198bd","unresolved":false,"context_lines":[{"line_number":95,"context_line":"        except TypeError as e:"},{"line_number":96,"context_line":"            # ... but if that causes an error, we appear to have the old ncclient"},{"line_number":97,"context_line":"            # installed, which doesn\u0027t understand this parameter."},{"line_number":98,"context_line":"            man \u003d self.ncclient.connect(host\u003dnexus_host,"},{"line_number":99,"context_line":"                                        port\u003dnexus_ssh_port,"},{"line_number":100,"context_line":"                                        username\u003dnexus_user,"},{"line_number":101,"context_line":"                                        password\u003dnexus_password)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_ce9683a0","line":98,"in_reply_to":"baada198_c8903bf6","updated":"2014-08-06 04:51:16.000000000","message":"The old except-block is still there. It starts at line 102 and handles all exceptions, except TypeError.","commit_id":"b8abf824e805f907bc1e1b1fde32cad4c2b595b1"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"f47c71e43d33862878344920b24891bd6a85b066","unresolved":false,"context_lines":[{"line_number":92,"context_line":"                                        username\u003dnexus_user,"},{"line_number":93,"context_line":"                                        password\u003dnexus_password,"},{"line_number":94,"context_line":"                                        device_params\u003d{ \"name\" : \"nexus\"})"},{"line_number":95,"context_line":"        except TypeError as e:"},{"line_number":96,"context_line":"            # ... but if that causes an error, we appear to have the old ncclient"},{"line_number":97,"context_line":"            # installed, which doesn\u0027t understand this parameter."},{"line_number":98,"context_line":"            man \u003d self.ncclient.connect(host\u003dnexus_host,"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_c9b11de5","line":95,"updated":"2014-08-06 05:59:58.000000000","message":"nit: e looks unused.","commit_id":"323cc6d6d27209e9e1eab003d2464656abb3a475"},{"author":{"_account_id":6139,"name":"Juergen Brendel","email":"jbrendel@cisco.com","username":"jbrendel"},"change_message_id":"f23288b0b58b85e19a7ef637ddf9319e43442bac","unresolved":false,"context_lines":[{"line_number":92,"context_line":"                                        username\u003dnexus_user,"},{"line_number":93,"context_line":"                                        password\u003dnexus_password,"},{"line_number":94,"context_line":"                                        device_params\u003d{ \"name\" : \"nexus\"})"},{"line_number":95,"context_line":"        except TypeError as e:"},{"line_number":96,"context_line":"            # ... but if that causes an error, we appear to have the old ncclient"},{"line_number":97,"context_line":"            # installed, which doesn\u0027t understand this parameter."},{"line_number":98,"context_line":"            man \u003d self.ncclient.connect(host\u003dnexus_host,"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_bac6c99a","line":95,"in_reply_to":"baada198_c9b11de5","updated":"2014-08-06 20:06:40.000000000","message":"Done","commit_id":"323cc6d6d27209e9e1eab003d2464656abb3a475"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"f78b57c284d42d40a4049fe0f14056f6e4720e5c","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        except Exception as e:"},{"line_number":103,"context_line":"            # Raise a Neutron exception. Include a description of"},{"line_number":104,"context_line":"            # the original ncclient exception."},{"line_number":105,"context_line":"            raise cexc.NexusConnectFailed(nexus_host\u003dnexus_host, exc\u003de)"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"        self.connections[nexus_host] \u003d man"},{"line_number":108,"context_line":"        return self.connections[nexus_host]"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_d5a2803e","line":105,"updated":"2014-08-06 13:14:14.000000000","message":"Unfortunately this information is completely lost when the exception gets back to MechanismManager._call_on_drivers(): \nhttps://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/managers.py#L163\n\nSo I think you should do a LOG.exception() here.","commit_id":"323cc6d6d27209e9e1eab003d2464656abb3a475"},{"author":{"_account_id":6139,"name":"Juergen Brendel","email":"jbrendel@cisco.com","username":"jbrendel"},"change_message_id":"f23288b0b58b85e19a7ef637ddf9319e43442bac","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        except Exception as e:"},{"line_number":103,"context_line":"            # Raise a Neutron exception. Include a description of"},{"line_number":104,"context_line":"            # the original ncclient exception."},{"line_number":105,"context_line":"            raise cexc.NexusConnectFailed(nexus_host\u003dnexus_host, exc\u003de)"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"        self.connections[nexus_host] \u003d man"},{"line_number":108,"context_line":"        return self.connections[nexus_host]"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_7a3351c4","line":105,"in_reply_to":"baada198_d5a2803e","updated":"2014-08-06 20:06:40.000000000","message":"We decided to address this issue in a separate patch.","commit_id":"323cc6d6d27209e9e1eab003d2464656abb3a475"}],"neutron/tests/unit/ml2/drivers/cisco/nexus/test_cisco_mech.py":[{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"529ce12db7031bcdd84243b775fb0ba16c8a002b","unresolved":false,"context_lines":[{"line_number":448,"context_line":"        # Patching ncclient.connect so that it causes a TypeError on the"},{"line_number":449,"context_line":"        # first call. Cisco ML2 driver code will then retry with different"},{"line_number":450,"context_line":"        # calling signature (no TypeError on second try)"},{"line_number":451,"context_line":"        with self._patch_ncclient_connect():"},{"line_number":452,"context_line":"            with self._create_resources() as result:"},{"line_number":453,"context_line":"                self.assertEqual(result.status_int,"},{"line_number":454,"context_line":"                                 wexc.HTTPOk.code)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_dd8f1b21","line":451,"updated":"2014-08-06 02:23:48.000000000","message":"Instead of this context manager you can use mock\u0027s side_effect feature:\n\n        connect \u003d self.mock_ncclient.connect\n        self.mock_ncclient.connect.side_effect \u003d [TypeError, connect]","commit_id":"b8abf824e805f907bc1e1b1fde32cad4c2b595b1"},{"author":{"_account_id":6139,"name":"Juergen Brendel","email":"jbrendel@cisco.com","username":"jbrendel"},"change_message_id":"d15011e9297a1b7bfb0e0fd8cd11732c846511ff","unresolved":false,"context_lines":[{"line_number":448,"context_line":"        # Patching ncclient.connect so that it causes a TypeError on the"},{"line_number":449,"context_line":"        # first call. Cisco ML2 driver code will then retry with different"},{"line_number":450,"context_line":"        # calling signature (no TypeError on second try)"},{"line_number":451,"context_line":"        with self._patch_ncclient_connect():"},{"line_number":452,"context_line":"            with self._create_resources() as result:"},{"line_number":453,"context_line":"                self.assertEqual(result.status_int,"},{"line_number":454,"context_line":"                                 wexc.HTTPOk.code)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_8e53ab39","line":451,"in_reply_to":"baada198_2e58df30","updated":"2014-08-06 05:42:15.000000000","message":"Done","commit_id":"b8abf824e805f907bc1e1b1fde32cad4c2b595b1"},{"author":{"_account_id":6139,"name":"Juergen Brendel","email":"jbrendel@cisco.com","username":"jbrendel"},"change_message_id":"d15011e9297a1b7bfb0e0fd8cd11732c846511ff","unresolved":false,"context_lines":[{"line_number":448,"context_line":"        # Patching ncclient.connect so that it causes a TypeError on the"},{"line_number":449,"context_line":"        # first call. Cisco ML2 driver code will then retry with different"},{"line_number":450,"context_line":"        # calling signature (no TypeError on second try)"},{"line_number":451,"context_line":"        with self._patch_ncclient_connect():"},{"line_number":452,"context_line":"            with self._create_resources() as result:"},{"line_number":453,"context_line":"                self.assertEqual(result.status_int,"},{"line_number":454,"context_line":"                                 wexc.HTTPOk.code)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_6e1d7777","line":451,"in_reply_to":"baada198_dd8f1b21","updated":"2014-08-06 05:42:15.000000000","message":"Ah, I get it. Sorry, I missed that little detail there in your use of mock. Ok, that\u0027s great. I\u0027ll do that instead.","commit_id":"b8abf824e805f907bc1e1b1fde32cad4c2b595b1"},{"author":{"_account_id":6139,"name":"Juergen Brendel","email":"jbrendel@cisco.com","username":"jbrendel"},"change_message_id":"f430c8128dc66d018f771438ece23ce080d198bd","unresolved":false,"context_lines":[{"line_number":448,"context_line":"        # Patching ncclient.connect so that it causes a TypeError on the"},{"line_number":449,"context_line":"        # first call. Cisco ML2 driver code will then retry with different"},{"line_number":450,"context_line":"        # calling signature (no TypeError on second try)"},{"line_number":451,"context_line":"        with self._patch_ncclient_connect():"},{"line_number":452,"context_line":"            with self._create_resources() as result:"},{"line_number":453,"context_line":"                self.assertEqual(result.status_int,"},{"line_number":454,"context_line":"                                 wexc.HTTPOk.code)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_2e58df30","line":451,"in_reply_to":"baada198_dd8f1b21","updated":"2014-08-06 04:51:16.000000000","message":"The problem is that the code I am calling will call connect() twice, but with different parameter lists. One should cause the Type error, the second call should not. As far as I see it there is no chance for me to change the side effect (via mock) between the two times that connect() is called. That\u0027s why I switched the connect function around somewhat manually.","commit_id":"b8abf824e805f907bc1e1b1fde32cad4c2b595b1"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"529ce12db7031bcdd84243b775fb0ba16c8a002b","unresolved":false,"context_lines":[{"line_number":452,"context_line":"            with self._create_resources() as result:"},{"line_number":453,"context_line":"                self.assertEqual(result.status_int,"},{"line_number":454,"context_line":"                                 wexc.HTTPOk.code)"},{"line_number":455,"context_line":""},{"line_number":456,"context_line":"    def test_nexus_connect_fail(self):"},{"line_number":457,"context_line":"        \"\"\"Test failure to connect to a Nexus switch."},{"line_number":458,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_dd955be4","line":455,"updated":"2014-08-06 02:23:48.000000000","message":"Please add a new test case for side_effect \u003d [TypeError, IOError] to cover the case that Mohammad found.","commit_id":"b8abf824e805f907bc1e1b1fde32cad4c2b595b1"},{"author":{"_account_id":6139,"name":"Juergen Brendel","email":"jbrendel@cisco.com","username":"jbrendel"},"change_message_id":"d15011e9297a1b7bfb0e0fd8cd11732c846511ff","unresolved":false,"context_lines":[{"line_number":452,"context_line":"            with self._create_resources() as result:"},{"line_number":453,"context_line":"                self.assertEqual(result.status_int,"},{"line_number":454,"context_line":"                                 wexc.HTTPOk.code)"},{"line_number":455,"context_line":""},{"line_number":456,"context_line":"    def test_nexus_connect_fail(self):"},{"line_number":457,"context_line":"        \"\"\"Test failure to connect to a Nexus switch."},{"line_number":458,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_ce13e366","line":455,"in_reply_to":"baada198_dd955be4","updated":"2014-08-06 05:42:15.000000000","message":"Will do.","commit_id":"b8abf824e805f907bc1e1b1fde32cad4c2b595b1"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"f78b57c284d42d40a4049fe0f14056f6e4720e5c","unresolved":false,"context_lines":[{"line_number":444,"context_line":"        with self._patch_ncclient(\u0027connect.side_effect\u0027,"},{"line_number":445,"context_line":"                                  [ TypeError, IOError ]):"},{"line_number":446,"context_line":"            with self._create_resources() as result:"},{"line_number":447,"context_line":"                self._assertExpectedHTTP(result.status_int,"},{"line_number":448,"context_line":"                                         c_exc.NexusConnectFailed)"},{"line_number":449,"context_line":""},{"line_number":450,"context_line":"    def test_nexus_connect_fail(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_c0ec80f7","line":447,"updated":"2014-08-06 13:14:14.000000000","message":"Unfortunately status_int is not a very good value to test. It is 500 for nearly all errors from the plugin. I think it would be better to log exceptions in the mech driver and test for them here.","commit_id":"323cc6d6d27209e9e1eab003d2464656abb3a475"},{"author":{"_account_id":6139,"name":"Juergen Brendel","email":"jbrendel@cisco.com","username":"jbrendel"},"change_message_id":"f23288b0b58b85e19a7ef637ddf9319e43442bac","unresolved":false,"context_lines":[{"line_number":444,"context_line":"        with self._patch_ncclient(\u0027connect.side_effect\u0027,"},{"line_number":445,"context_line":"                                  [ TypeError, IOError ]):"},{"line_number":446,"context_line":"            with self._create_resources() as result:"},{"line_number":447,"context_line":"                self._assertExpectedHTTP(result.status_int,"},{"line_number":448,"context_line":"                                         c_exc.NexusConnectFailed)"},{"line_number":449,"context_line":""},{"line_number":450,"context_line":"    def test_nexus_connect_fail(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_1abb3511","line":447,"in_reply_to":"baada198_c0ec80f7","updated":"2014-08-06 20:06:40.000000000","message":"We decided to address this issue in a separate patch.","commit_id":"323cc6d6d27209e9e1eab003d2464656abb3a475"}]}
