)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"f5c199f2cc2b58fa334d717d45f5d967b9184364","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Dane LeBlanc \u003cleblancd@cisco.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2013-04-30 07:36:22 -0400"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Cisco nexus plugin fails for vlan IDs 1006-4094"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Fixes bug 1174593"},{"line_number":10,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"AAAAOn%2F%2FpdE%3D","line":7,"updated":"2013-04-30 17:24:48.000000000","message":"I\u0027m afraid I don\u0027t consider my concern addressed.  The current summary states a problem rather than indicating what this patch addresses.  Please change the summary line to reflect the patch intention (e.g. Fix nexus plugin failures with vlan range 1006-4094).  \n\nReference: https://wiki.openstack.org/wiki/Gerrit_Workflow","commit_id":"66a9fabdae765630244d47340cf348aa361a0ad6"}],"quantum/plugins/cisco/nexus/cisco_nexus_network_driver_v2.py":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"unresolved":false,"context_lines":[{"line_number":53,"context_line":"            mgr.edit_config(target, config\u003dconfig)"},{"line_number":54,"context_line":"        except Exception as e:"},{"line_number":55,"context_line":"            for exc_str in allowed_exc_strs:"},{"line_number":56,"context_line":"                if exc_str in repr(e):"},{"line_number":57,"context_line":"                    break"},{"line_number":58,"context_line":"            else:"},{"line_number":59,"context_line":"                # Raise a Quantum exception. Include a description of"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAO3%2F%2F%2Fks%3D","line":56,"updated":"2013-05-15 11:42:49.000000000","message":"Could just use e.message to get the string only, instead of the full representation of the exception:\n\nAlso, couldn\u0027t this be:\n\nif e.message in allowed_exc_strs:\n    break\nelse:\n    raise ...","commit_id":"4d9bd0432284647bda1cc9c7c8a053a33350e4ec"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"56849243a0a008b975c5611834d2c1dcfbf57faf","unresolved":false,"context_lines":[{"line_number":53,"context_line":"            mgr.edit_config(target, config\u003dconfig)"},{"line_number":54,"context_line":"        except Exception as e:"},{"line_number":55,"context_line":"            for exc_str in allowed_exc_strs:"},{"line_number":56,"context_line":"                if exc_str in repr(e):"},{"line_number":57,"context_line":"                    break"},{"line_number":58,"context_line":"            else:"},{"line_number":59,"context_line":"                # Raise a Quantum exception. Include a description of"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAO3%2F%2F%2FGM%3D","line":56,"in_reply_to":"AAAAO3%2F%2F%2Fks%3D","updated":"2013-05-15 19:26:37.000000000","message":"The use of e.message is being deprecated, but str(e) would work here.\nHowever, \"if str(e) in allowed_exc_strs:\" won\u0027t work because the strings in allowed_exc_strs are subsets of the exception strings (the exception strings contain instances of VLAN IDs, which we don\u0027t want to instantiate in the match strings).","commit_id":"4d9bd0432284647bda1cc9c7c8a053a33350e4ec"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"56849243a0a008b975c5611834d2c1dcfbf57faf","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        :param mgr: NetConf client manager"},{"line_number":45,"context_line":"        :param target: Target config type"},{"line_number":46,"context_line":"        :param config: Configuration string in XML format"},{"line_number":47,"context_line":"        :param allowed_exc_str: Exceptions with this repr can be ignored"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"        :raises: NexusConfigFailed"},{"line_number":50,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAO3%2F%2F%2BZE%3D","line":47,"updated":"2013-05-15 19:34:23.000000000","message":"Oops, forgot to update this param description.","commit_id":"fd0874728a9f9856dbbe07553a7238397e291d54"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"unresolved":false,"context_lines":[{"line_number":53,"context_line":"            mgr.edit_config(target, config\u003dconfig)"},{"line_number":54,"context_line":"        except Exception as e:"},{"line_number":55,"context_line":"            for exc_str in allowed_exc_strs:"},{"line_number":56,"context_line":"                if exc_str in str(e):"},{"line_number":57,"context_line":"                    break"},{"line_number":58,"context_line":"            else:"},{"line_number":59,"context_line":"                # Raise a Quantum exception. Include a description of"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAO3%2F%2F%2BYo%3D","line":56,"updated":"2013-05-15 19:39:30.000000000","message":"Understand your previous comment about the allowed_exc_strs being only a portion of the actual error message.  Would we want to use the actual string (see below comment), or could there be multiple exceptions using the keywords desired?\n\nConcerned about brittleness with the string literals.","commit_id":"fd0874728a9f9856dbbe07553a7238397e291d54"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"unresolved":false,"context_lines":[{"line_number":101,"context_line":"                    mgr,"},{"line_number":102,"context_line":"                    target\u003d\u0027running\u0027,"},{"line_number":103,"context_line":"                    config\u003dconfstr,"},{"line_number":104,"context_line":"                    allowed_exc_strs\u003d[\"Can\u0027t modify state for extended\","},{"line_number":105,"context_line":"                                      \"Command is only allowed on VLAN\"])"},{"line_number":106,"context_line":"            except Exception as e:"},{"line_number":107,"context_line":"                # Rollback VLAN creation"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAO3%2F%2F%2BYg%3D","line":104,"updated":"2013-05-15 19:39:30.000000000","message":"Here was where I was wondering if we can reference the exception strings.","commit_id":"fd0874728a9f9856dbbe07553a7238397e291d54"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"unresolved":false,"context_lines":[{"line_number":38,"context_line":"        pass"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _edit_config(self, mgr, target\u003d\u0027running\u0027, config\u003d\u0027\u0027,"},{"line_number":41,"context_line":"                     allowed_exc_strs\u003d[]):"},{"line_number":42,"context_line":"        \"\"\"Modify switch config for a target config type."},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"        :param mgr: NetConf client manager"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAO3%2F%2F%2BMI%3D","line":41,"updated":"2013-05-15 20:47:14.000000000","message":"the allowed_exc_strs default param should not be [] as this has side effects. For example: \n\nIn [1]: def foo(a\u003d[]):\n   ...:     print a\n   ...:     a.append(\"static member\")\n   ...:     \n\nIn [2]: foo()\n[]\n\nIn [3]: foo()\n[\u0027static member\u0027]","commit_id":"a5469ad05b0a29bfada2d49502b60c183e0d1b0b"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"56849243a0a008b975c5611834d2c1dcfbf57faf","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        pass"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def _edit_config(self, mgr, target\u003d\u0027running\u0027, config\u003d\u0027\u0027,"},{"line_number":41,"context_line":"                     allowed_exc_strs\u003d[]):"},{"line_number":42,"context_line":"        \"\"\"Modify switch config for a target config type."},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"        :param mgr: NetConf client manager"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAO3%2F%2F97o%3D","line":41,"in_reply_to":"AAAAO3%2F%2F%2BMI%3D","updated":"2013-05-15 23:17:45.000000000","message":"Done","commit_id":"a5469ad05b0a29bfada2d49502b60c183e0d1b0b"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"unresolved":false,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        \"\"\""},{"line_number":54,"context_line":"        try:"},{"line_number":55,"context_line":"            mgr.edit_config(target, config\u003dconfig)"},{"line_number":56,"context_line":"        except Exception as e:"},{"line_number":57,"context_line":"            for exc_str in allowed_exc_strs:"},{"line_number":58,"context_line":"                if exc_str in str(e):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAO3%2F%2F%2BME%3D","line":55,"updated":"2013-05-15 20:47:14.000000000","message":"This would be better if edit_config() raised a specific kind of exception and you did except(foo, bar, TypeError) rather than looking at the message in the exception.","commit_id":"a5469ad05b0a29bfada2d49502b60c183e0d1b0b"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"56849243a0a008b975c5611834d2c1dcfbf57faf","unresolved":false,"context_lines":[{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        \"\"\""},{"line_number":54,"context_line":"        try:"},{"line_number":55,"context_line":"            mgr.edit_config(target, config\u003dconfig)"},{"line_number":56,"context_line":"        except Exception as e:"},{"line_number":57,"context_line":"            for exc_str in allowed_exc_strs:"},{"line_number":58,"context_line":"                if exc_str in str(e):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAO3%2F%2F91w%3D","line":55,"in_reply_to":"AAAAO3%2F%2F%2BME%3D","updated":"2013-05-15 23:17:45.000000000","message":"It would be better, but edit_config() is part of a 3rd party module (ncclient), so I can\u0027t easily change this behavior. :o(  The type of exception that is raised by ncclient in this case is RPCError, and this is raised by the ncclient with different messages, depending on the specific error condition.","commit_id":"a5469ad05b0a29bfada2d49502b60c183e0d1b0b"},{"author":{"_account_id":490,"name":"Sumit Naiksatam","email":"sumitnaiksatam@gmail.com","username":"snaiksat"},"unresolved":false,"context_lines":[{"line_number":104,"context_line":"                    target\u003d\u0027running\u0027,"},{"line_number":105,"context_line":"                    config\u003dconfstr,"},{"line_number":106,"context_line":"                    allowed_exc_strs\u003d[\"Can\u0027t modify state for extended\","},{"line_number":107,"context_line":"                                      \"Command is only allowed on VLAN\"])"},{"line_number":108,"context_line":"            except Exception as e:"},{"line_number":109,"context_line":"                # Rollback VLAN creation"},{"line_number":110,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAO3%2F%2F%2BLs%3D","line":107,"updated":"2013-05-15 20:50:26.000000000","message":"Ideally you would want to put these strings in a config file.","commit_id":"a5469ad05b0a29bfada2d49502b60c183e0d1b0b"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"56849243a0a008b975c5611834d2c1dcfbf57faf","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                    target\u003d\u0027running\u0027,"},{"line_number":105,"context_line":"                    config\u003dconfstr,"},{"line_number":106,"context_line":"                    allowed_exc_strs\u003d[\"Can\u0027t modify state for extended\","},{"line_number":107,"context_line":"                                      \"Command is only allowed on VLAN\"])"},{"line_number":108,"context_line":"            except Exception as e:"},{"line_number":109,"context_line":"                # Rollback VLAN creation"},{"line_number":110,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAO3%2F%2F9xQ%3D","line":107,"in_reply_to":"AAAAO3%2F%2F%2BLs%3D","updated":"2013-05-15 23:17:45.000000000","message":"I was trying to avoid requiring the user to have detailed knowledge (or have to look up this info in some device/version matrix in a config guide) of device-specific or even SW-version-specific behavior. If this exception string list is added to the plugin configuration, and let\u0027s say we default this to an empty list, then customers would need to look up in a configuration guide which exception strings need to be configured as ignorable. In addition to SW-version dependencies, the resulting matrix (ideally) might also need to consider for which commands the exceptions can be ignored (e.g. ignore for \u0027state active\u0027 or  \u0027no shutdown\u0027, otherwise the exception shouldn\u0027t be ignored). I can add this to the config, but is this really the approach that we want to take?","commit_id":"a5469ad05b0a29bfada2d49502b60c183e0d1b0b"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"56849243a0a008b975c5611834d2c1dcfbf57faf","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                    target\u003d\u0027running\u0027,"},{"line_number":105,"context_line":"                    config\u003dconfstr,"},{"line_number":106,"context_line":"                    allowed_exc_strs\u003d[\"Can\u0027t modify state for extended\","},{"line_number":107,"context_line":"                                      \"Command is only allowed on VLAN\"])"},{"line_number":108,"context_line":"            except Exception as e:"},{"line_number":109,"context_line":"                # Rollback VLAN creation"},{"line_number":110,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAO3%2F%2F8u0%3D","line":107,"in_reply_to":"AAAAO3%2F%2F9tY%3D","updated":"2013-05-16 12:53:26.000000000","message":"Yes, this makes sense. I\u0027ll file a separate bug to add a configuration mechanism to override this list of ignorable exception strings, so that this bug fix can go through. If it\u0027s okay, I\u0027ll wait until after this bug fix is merged before filing the new bug, since the new enhancement will depend on this current fix.","commit_id":"a5469ad05b0a29bfada2d49502b60c183e0d1b0b"},{"author":{"_account_id":490,"name":"Sumit Naiksatam","email":"sumitnaiksatam@gmail.com","username":"snaiksat"},"unresolved":false,"context_lines":[{"line_number":104,"context_line":"                    target\u003d\u0027running\u0027,"},{"line_number":105,"context_line":"                    config\u003dconfstr,"},{"line_number":106,"context_line":"                    allowed_exc_strs\u003d[\"Can\u0027t modify state for extended\","},{"line_number":107,"context_line":"                                      \"Command is only allowed on VLAN\"])"},{"line_number":108,"context_line":"            except Exception as e:"},{"line_number":109,"context_line":"                # Rollback VLAN creation"},{"line_number":110,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAO3%2F%2F9tY%3D","line":107,"in_reply_to":"AAAAO3%2F%2F9xQ%3D","updated":"2013-05-15 23:34:54.000000000","message":"Let\u0027s say that in a different software version, the exception string changes. I would imagine it would be much easier to change it in the config file rather that have to fix it in the code. You have already identified which exception strings are in the default list, so those could be just moved to the config and the user does not need to change this unless the default needs to change.\nIn general, it seems odd to me have literals which are defined in an external system be hard coded here.\nAt any rate, this is a minor point, and I am not stuck on this, if you think it\u0027s not worth the effort. Otherwise, the change looks good to me.","commit_id":"a5469ad05b0a29bfada2d49502b60c183e0d1b0b"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"unresolved":false,"context_lines":[{"line_number":105,"context_line":"                    config\u003dconfstr,"},{"line_number":106,"context_line":"                    allowed_exc_strs\u003d[\"Can\u0027t modify state for extended\","},{"line_number":107,"context_line":"                                      \"Command is only allowed on VLAN\"])"},{"line_number":108,"context_line":"            except Exception as e:"},{"line_number":109,"context_line":"                # Rollback VLAN creation"},{"line_number":110,"context_line":"                try:"},{"line_number":111,"context_line":"                    self.disable_vlan(mgr, vlanid)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAO3%2F%2F%2BL8%3D","line":108,"updated":"2013-05-15 20:47:14.000000000","message":"better to actually catch the specific exception that was raised that everything.","commit_id":"a5469ad05b0a29bfada2d49502b60c183e0d1b0b"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"56849243a0a008b975c5611834d2c1dcfbf57faf","unresolved":false,"context_lines":[{"line_number":105,"context_line":"                    config\u003dconfstr,"},{"line_number":106,"context_line":"                    allowed_exc_strs\u003d[\"Can\u0027t modify state for extended\","},{"line_number":107,"context_line":"                                      \"Command is only allowed on VLAN\"])"},{"line_number":108,"context_line":"            except Exception as e:"},{"line_number":109,"context_line":"                # Rollback VLAN creation"},{"line_number":110,"context_line":"                try:"},{"line_number":111,"context_line":"                    self.disable_vlan(mgr, vlanid)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAO3%2F%2F9wM%3D","line":108,"in_reply_to":"AAAAO3%2F%2F%2BL8%3D","updated":"2013-05-15 23:17:45.000000000","message":"Agreed. There should only be exceptions of type cexp.NexusConfigFailed at this point.","commit_id":"a5469ad05b0a29bfada2d49502b60c183e0d1b0b"}],"quantum/tests/unit/cisco/test_network_plugin.py":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"unresolved":false,"context_lines":[{"line_number":297,"context_line":"        \"\"\""},{"line_number":298,"context_line":"        class FakeRPCErrorA(Exception):"},{"line_number":299,"context_line":"            def __repr__(self):"},{"line_number":300,"context_line":"                return \"Can\u0027t modify state for extended\""},{"line_number":301,"context_line":""},{"line_number":302,"context_line":"        class FakeRPCErrorB(Exception):"},{"line_number":303,"context_line":"            def __repr__(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAO3%2F%2F%2FjU%3D","line":300,"updated":"2013-05-15 11:42:49.000000000","message":"Wouldn\u0027t repr typically have type info for these two custom classes?","commit_id":"4d9bd0432284647bda1cc9c7c8a053a33350e4ec"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"56849243a0a008b975c5611834d2c1dcfbf57faf","unresolved":false,"context_lines":[{"line_number":297,"context_line":"        \"\"\""},{"line_number":298,"context_line":"        class FakeRPCErrorA(Exception):"},{"line_number":299,"context_line":"            def __repr__(self):"},{"line_number":300,"context_line":"                return \"Can\u0027t modify state for extended\""},{"line_number":301,"context_line":""},{"line_number":302,"context_line":"        class FakeRPCErrorB(Exception):"},{"line_number":303,"context_line":"            def __repr__(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAO3%2F%2F%2FFQ%3D","line":300,"in_reply_to":"AAAAO3%2F%2F%2FjU%3D","updated":"2013-05-15 19:26:37.000000000","message":"I\u0027ll switch to using the exception message.","commit_id":"4d9bd0432284647bda1cc9c7c8a053a33350e4ec"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"unresolved":false,"context_lines":[{"line_number":305,"context_line":""},{"line_number":306,"context_line":"        def mock_edit_config_a(target, config):"},{"line_number":307,"context_line":"            if all(word in config for word in [\u0027state\u0027, \u0027active\u0027]):"},{"line_number":308,"context_line":"                raise FakeRPCErrorA"},{"line_number":309,"context_line":""},{"line_number":310,"context_line":"        with self._patch_ncclient("},{"line_number":311,"context_line":"            \u0027manager.connect.return_value.edit_config.side_effect\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAO3%2F%2F%2FjM%3D","line":308,"updated":"2013-05-15 11:42:49.000000000","message":"Couldn\u0027t you just do:\nraise Exception(\"some message\")\n\nInstead of using custom exception?","commit_id":"4d9bd0432284647bda1cc9c7c8a053a33350e4ec"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"56849243a0a008b975c5611834d2c1dcfbf57faf","unresolved":false,"context_lines":[{"line_number":305,"context_line":""},{"line_number":306,"context_line":"        def mock_edit_config_a(target, config):"},{"line_number":307,"context_line":"            if all(word in config for word in [\u0027state\u0027, \u0027active\u0027]):"},{"line_number":308,"context_line":"                raise FakeRPCErrorA"},{"line_number":309,"context_line":""},{"line_number":310,"context_line":"        with self._patch_ncclient("},{"line_number":311,"context_line":"            \u0027manager.connect.return_value.edit_config.side_effect\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAO3%2F%2F%2FEw%3D","line":308,"in_reply_to":"AAAAO3%2F%2F%2FjM%3D","updated":"2013-05-15 19:26:37.000000000","message":"Done","commit_id":"4d9bd0432284647bda1cc9c7c8a053a33350e4ec"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"unresolved":false,"context_lines":[{"line_number":309,"context_line":""},{"line_number":310,"context_line":"        with self._patch_ncclient("},{"line_number":311,"context_line":"            \u0027manager.connect.return_value.edit_config.side_effect\u0027,"},{"line_number":312,"context_line":"            mock_edit_config_a):"},{"line_number":313,"context_line":"            with self._create_port_res(self.fmt, name\u003d\u0027myname\u0027) as res:"},{"line_number":314,"context_line":"                self.assertEqual(res.status_int, wexc.HTTPCreated.code)"},{"line_number":315,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAO3%2F%2F%2FhU%3D","line":312,"updated":"2013-05-15 11:42:49.000000000","message":"Not sure I follow all the mocking here. What branch is this on (so that I can see the rest of the code not in the diff set)?\n\nCouldn\u0027t this be side_effect\u003dException(\"blah\"), instead of mock_edit_config_a?\n\nHow does the _create_port_res() call sequence generate config arg for the side effect with \"state\" and \"active\" (versus \"no\" and \"shutdown\", as in the following code)?\n\nWondering why there is a conditional test in the side effect function and how the parameters are getting there.","commit_id":"4d9bd0432284647bda1cc9c7c8a053a33350e4ec"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"56849243a0a008b975c5611834d2c1dcfbf57faf","unresolved":false,"context_lines":[{"line_number":309,"context_line":""},{"line_number":310,"context_line":"        with self._patch_ncclient("},{"line_number":311,"context_line":"            \u0027manager.connect.return_value.edit_config.side_effect\u0027,"},{"line_number":312,"context_line":"            mock_edit_config_a):"},{"line_number":313,"context_line":"            with self._create_port_res(self.fmt, name\u003d\u0027myname\u0027) as res:"},{"line_number":314,"context_line":"                self.assertEqual(res.status_int, wexc.HTTPCreated.code)"},{"line_number":315,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAO3%2F%2F%2B%2FU%3D","line":312,"in_reply_to":"AAAAO3%2F%2F%2FhU%3D","updated":"2013-05-15 19:26:37.000000000","message":"This is chained mocking on a mock object. This is on upstream master.\nNo, \u0027side_effect\u003dException(...)\u0027 won\u0027t work because that would raise an exception for every call to edit_config. There are 3 calls to edit_config when a port is created (which translates to a nexus plugin network create):\n    - create the vlan\n    - change state to active (\u0027state active\u0027)\n    - change state to admin up (\u0027no shutdown\u0027)\nWe want to simulate extended vlan errors for the 2nd or 3rd of these calls to edit_config, but not the first. (See the commit message for some background details.)\nThe _create_port_res() call sequence causes the Cisco nexus driver to generate XML config snippets according to the above config operations, including \u0027state\u0027 and \u0027active\u0027 for the 2nd operation and \u0027no\u0027 and \u0027shutdown\u0027 for the 3rd operation.\u0027","commit_id":"4d9bd0432284647bda1cc9c7c8a053a33350e4ec"},{"author":{"_account_id":6694,"name":"rcurran","email":"rcurran@cisco.com","username":"rcurran"},"change_message_id":"d048fe4c68165f5b8d47fac93eb329219e596f40","unresolved":false,"context_lines":[{"line_number":315,"context_line":""},{"line_number":316,"context_line":"        def mock_edit_config_b(target, config):"},{"line_number":317,"context_line":"            if all(word in config for word in [\u0027no\u0027, \u0027shutdown\u0027]):"},{"line_number":318,"context_line":"                raise FakeRPCErrorB"},{"line_number":319,"context_line":"        with self._patch_ncclient("},{"line_number":320,"context_line":"            \u0027manager.connect.return_value.edit_config.side_effect\u0027,"},{"line_number":321,"context_line":"            mock_edit_config_b):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOn%2F%2FUsI%3D","line":318,"updated":"2013-05-14 18:11:58.000000000","message":"Need a blank line here.","commit_id":"4d9bd0432284647bda1cc9c7c8a053a33350e4ec"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"56849243a0a008b975c5611834d2c1dcfbf57faf","unresolved":false,"context_lines":[{"line_number":315,"context_line":""},{"line_number":316,"context_line":"        def mock_edit_config_b(target, config):"},{"line_number":317,"context_line":"            if all(word in config for word in [\u0027no\u0027, \u0027shutdown\u0027]):"},{"line_number":318,"context_line":"                raise FakeRPCErrorB"},{"line_number":319,"context_line":"        with self._patch_ncclient("},{"line_number":320,"context_line":"            \u0027manager.connect.return_value.edit_config.side_effect\u0027,"},{"line_number":321,"context_line":"            mock_edit_config_b):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAO3%2F%2F%2FEE%3D","line":318,"in_reply_to":"AAAAOn%2F%2FUsI%3D","updated":"2013-05-15 19:26:37.000000000","message":"Done","commit_id":"4d9bd0432284647bda1cc9c7c8a053a33350e4ec"}]}
