)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8410,"name":"Richard Theis","email":"rtheis@us.ibm.com","username":"rtheis"},"change_message_id":"498e5c97f9bbafe161c0e043c55ad96b104a9a98","unresolved":false,"context_lines":[{"line_number":15,"context_line":"Also return a non-zero exit code."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: I39ae087dd7bd08d049d513abfa6c5cab2bd13b2b"},{"line_number":18,"context_line":"Partial-Bug: #1556719"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"1af94dfe_2a150d9b","line":18,"updated":"2016-03-18 18:36:37.000000000","message":"This is also \"Partial-Bug: #1537856\".  Also it would be good to update doc/source/command-errors.rst to highlight delete with nargs.","commit_id":"d4363b05f1559c403b69734de2a11cd61e784ac8"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"412b8ec7e2ceea4aaabcc58929495984f4a3aa15","unresolved":false,"context_lines":[{"line_number":15,"context_line":"Also return a non-zero exit code."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: I39ae087dd7bd08d049d513abfa6c5cab2bd13b2b"},{"line_number":18,"context_line":"Partial-Bug: #1556719"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"1af94dfe_16d30e61","line":18,"in_reply_to":"1af94dfe_2a150d9b","updated":"2016-03-19 02:06:14.000000000","message":"Done","commit_id":"d4363b05f1559c403b69734de2a11cd61e784ac8"}],"doc/source/command-errors.rst":[{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"4c10a25bbc677e5b14316579d22f9cb0b7316c5f","unresolved":false,"context_lines":[{"line_number":190,"context_line":"                try:"},{"line_number":191,"context_line":"                    obj \u003d client.find_network(network, ignore_missing\u003dFalse)"},{"line_number":192,"context_line":"                    client.delete_network(obj)"},{"line_number":193,"context_line":"                except openstack_exceptions.ResourceNotFound:"},{"line_number":194,"context_line":"                    self.app.log.error(\"No network found with name or ID %s.\""},{"line_number":195,"context_line":"                                       % network)"},{"line_number":196,"context_line":"                    ret +\u003d 1"}],"source_content_type":"text/x-rst","patch_set":10,"id":"7a1b2928_71418f39","line":193,"range":{"start_line":193,"start_character":44,"end_line":193,"end_character":60},"updated":"2016-04-11 07:57:52.000000000","message":"I don\u0027t see \"ResourceNotFound\" exception is present in openstackclient, it\u0027s in openstacksdk, right? Just a confirmation.","commit_id":"8512c1eba4999052a9b1a1ef082580a670828588"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"72c9cf72691fd60d6c0133782768403986b23bf2","unresolved":false,"context_lines":[{"line_number":190,"context_line":"                try:"},{"line_number":191,"context_line":"                    obj \u003d client.find_network(network, ignore_missing\u003dFalse)"},{"line_number":192,"context_line":"                    client.delete_network(obj)"},{"line_number":193,"context_line":"                except openstack_exceptions.ResourceNotFound:"},{"line_number":194,"context_line":"                    self.app.log.error(\"No network found with name or ID %s.\""},{"line_number":195,"context_line":"                                       % network)"},{"line_number":196,"context_line":"                    ret +\u003d 1"}],"source_content_type":"text/x-rst","patch_set":10,"id":"5a18252c_8f2fe9a0","line":193,"range":{"start_line":193,"start_character":44,"end_line":193,"end_character":60},"in_reply_to":"7a1b2928_71418f39","updated":"2016-04-12 01:55:44.000000000","message":"Yes. This is not a good example. I\u0027ll change this. :)","commit_id":"8512c1eba4999052a9b1a1ef082580a670828588"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"3b1af308352924a190cc2a1a56840806fbe56108","unresolved":false,"context_lines":[{"line_number":200,"context_line":"                msg \u003d \"Failed to delete %s of %s networks.\" % (ret, total)"},{"line_number":201,"context_line":"                raise exceptions.CommandError(msg)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"        def take_action_compute(self, client, parsed_args):"},{"line_number":204,"context_line":"            ret \u003d 0"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"            for network in parsed_args.network:"},{"line_number":207,"context_line":"                try:"},{"line_number":208,"context_line":"                    network \u003d utils.find_resource(client.networks, network)"},{"line_number":209,"context_line":"                    client.networks.delete(network.id)"},{"line_number":210,"context_line":"                except Exception:"},{"line_number":211,"context_line":"                    self.app.log.error(\"Failed to delete network with name \""},{"line_number":212,"context_line":"                                       \"or ID %s.\" % network)"},{"line_number":213,"context_line":"                    ret +\u003d 1"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"            if ret \u003e 0:"},{"line_number":216,"context_line":"                total \u003d len(parsed_args.network)"},{"line_number":217,"context_line":"                msg \u003d \"Failed to delete %s of %s networks.\" % (ret, total)"},{"line_number":218,"context_line":"                raise exceptions.CommandError(msg)"}],"source_content_type":"text/x-rst","patch_set":11,"id":"5a18252c_6064e4e4","line":218,"range":{"start_line":203,"start_character":0,"end_line":218,"end_character":50},"updated":"2016-04-13 02:39:24.000000000","message":"As an example, I think we don\u0027t need the duplicate logic that might make confuse, remove any one to help others focusing at code logic, just a suggestion.","commit_id":"daf1088850e57d4dcf08539257d41dda851388eb"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"9ec1f562d0b41230580da590f388dc940e9fbe54","unresolved":false,"context_lines":[{"line_number":200,"context_line":"                msg \u003d \"Failed to delete %s of %s networks.\" % (ret, total)"},{"line_number":201,"context_line":"                raise exceptions.CommandError(msg)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"        def take_action_compute(self, client, parsed_args):"},{"line_number":204,"context_line":"            ret \u003d 0"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"            for network in parsed_args.network:"},{"line_number":207,"context_line":"                try:"},{"line_number":208,"context_line":"                    network \u003d utils.find_resource(client.networks, network)"},{"line_number":209,"context_line":"                    client.networks.delete(network.id)"},{"line_number":210,"context_line":"                except Exception:"},{"line_number":211,"context_line":"                    self.app.log.error(\"Failed to delete network with name \""},{"line_number":212,"context_line":"                                       \"or ID %s.\" % network)"},{"line_number":213,"context_line":"                    ret +\u003d 1"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"            if ret \u003e 0:"},{"line_number":216,"context_line":"                total \u003d len(parsed_args.network)"},{"line_number":217,"context_line":"                msg \u003d \"Failed to delete %s of %s networks.\" % (ret, total)"},{"line_number":218,"context_line":"                raise exceptions.CommandError(msg)"}],"source_content_type":"text/x-rst","patch_set":11,"id":"5a18252c_793f3f87","line":218,"range":{"start_line":203,"start_character":0,"end_line":218,"end_character":50},"in_reply_to":"5a18252c_6064e4e4","updated":"2016-04-14 06:52:46.000000000","message":"Done","commit_id":"daf1088850e57d4dcf08539257d41dda851388eb"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"6c3ae6007fcd1de2746f54a1673b17eb17e39b3e","unresolved":false,"context_lines":[{"line_number":166,"context_line":"~~~~~~~~~"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"This example is taken from the ``network delete`` command which takes multiple"},{"line_number":169,"context_line":"networks to delete. All networks will be delete in a loop, which makes multiple"},{"line_number":170,"context_line":"``delete_network()`` calls."},{"line_number":171,"context_line":""},{"line_number":172,"context_line":".. code-block:: python"}],"source_content_type":"text/x-rst","patch_set":13,"id":"dab17558_99cbe3a3","line":169,"range":{"start_line":169,"start_character":41,"end_line":169,"end_character":47},"updated":"2016-05-17 02:14:31.000000000","message":"deleted*","commit_id":"56f9227063cb86594600ccc80c661101f0f0c2c8"},{"author":{"_account_id":6482,"name":"Steve Martinelli","email":"s.martinelli@gmail.com","username":"stevemar"},"change_message_id":"6c3ae6007fcd1de2746f54a1673b17eb17e39b3e","unresolved":false,"context_lines":[{"line_number":179,"context_line":"                \u0027network\u0027,"},{"line_number":180,"context_line":"                metavar\u003d\"\u003cnetwork\u003e\","},{"line_number":181,"context_line":"                nargs\u003d\"+\","},{"line_number":182,"context_line":"                help\u003d(\"Network(s) to delete (name or ID)\")"},{"line_number":183,"context_line":"            )"},{"line_number":184,"context_line":"            return parser"},{"line_number":185,"context_line":""}],"source_content_type":"text/x-rst","patch_set":13,"id":"dab17558_d9c1eb81","line":182,"range":{"start_line":182,"start_character":21,"end_line":182,"end_character":22},"updated":"2016-05-17 02:14:31.000000000","message":"use _(","commit_id":"56f9227063cb86594600ccc80c661101f0f0c2c8"}],"openstackclient/network/common.py":[{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"3b1af308352924a190cc2a1a56840806fbe56108","unresolved":false,"context_lines":[{"line_number":104,"context_line":"            raise exceptions.CommandError(msg)"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    @abc.abstractmethod"},{"line_number":107,"context_line":"    def take_action_network(self, client, resource):"},{"line_number":108,"context_line":"        \"\"\"Override to do something useful.\"\"\""},{"line_number":109,"context_line":"        pass"},{"line_number":110,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_80030042","line":107,"range":{"start_line":107,"start_character":8,"end_line":107,"end_character":27},"updated":"2016-04-13 02:39:24.000000000","message":"override the super method, but change the last of argument from parsed_args to resources, I don\u0027t sure that\u0027s reasonable behavior, waiting others reviewing.\n\nmoreover, any exceptions shouldn\u0027t be caught in the two new methods(take_action_network and take_action_compute), we should add these into doc string.","commit_id":"daf1088850e57d4dcf08539257d41dda851388eb"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"9ec1f562d0b41230580da590f388dc940e9fbe54","unresolved":false,"context_lines":[{"line_number":104,"context_line":"            raise exceptions.CommandError(msg)"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"    @abc.abstractmethod"},{"line_number":107,"context_line":"    def take_action_network(self, client, resource):"},{"line_number":108,"context_line":"        \"\"\"Override to do something useful.\"\"\""},{"line_number":109,"context_line":"        pass"},{"line_number":110,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_6ecdaeb6","line":107,"range":{"start_line":107,"start_character":8,"end_line":107,"end_character":27},"in_reply_to":"5a18252c_80030042","updated":"2016-04-14 06:52:46.000000000","message":"OK, but I need to add one more class attribute to avoid passing the resource to take_action_network/compute(). Please see my next version patch.\n\nAnd we don\u0027t catch exceptions in take_action_network/compute(). All exception handling should be put in this function because it is not necessary to handle all exception raised by the server. Just catch them, and print the message to user.","commit_id":"daf1088850e57d4dcf08539257d41dda851388eb"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"397026bcb96cfcdea2b7f98c98faebfa27e3145d","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                                                      self.resource)"},{"line_number":105,"context_line":"            raise exceptions.CommandError(msg)"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    @abc.abstractmethod"},{"line_number":108,"context_line":"    def take_action_network(self, client, resource):"},{"line_number":109,"context_line":"        \"\"\"Override to do something useful.\"\"\""},{"line_number":110,"context_line":"        pass"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    @abc.abstractmethod"},{"line_number":113,"context_line":"    def take_action_compute(self, client, resource):"},{"line_number":114,"context_line":"        \"\"\"Override to do something useful.\"\"\""},{"line_number":115,"context_line":"        pass"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a18252c_c2949344","line":115,"range":{"start_line":107,"start_character":0,"end_line":115,"end_character":12},"updated":"2016-04-14 08:45:56.000000000","message":"these methods aren\u0027t necessary now.","commit_id":"884ba4f56db08c7abcb5ffb44597922f74501dee"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"04cf986641a97a0489c90f261dcdf0f2cee47951","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                                                      self.resource)"},{"line_number":105,"context_line":"            raise exceptions.CommandError(msg)"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    @abc.abstractmethod"},{"line_number":108,"context_line":"    def take_action_network(self, client, resource):"},{"line_number":109,"context_line":"        \"\"\"Override to do something useful.\"\"\""},{"line_number":110,"context_line":"        pass"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    @abc.abstractmethod"},{"line_number":113,"context_line":"    def take_action_compute(self, client, resource):"},{"line_number":114,"context_line":"        \"\"\"Override to do something useful.\"\"\""},{"line_number":115,"context_line":"        pass"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":12,"id":"5a18252c_73291337","line":115,"range":{"start_line":107,"start_character":0,"end_line":115,"end_character":12},"in_reply_to":"5a18252c_c2949344","updated":"2016-04-14 09:25:10.000000000","message":"Oh yes, indeed. :)","commit_id":"884ba4f56db08c7abcb5ffb44597922f74501dee"}],"openstackclient/network/v2/network.py":[{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"31c88ab0337feef11d75155c35297a2e688ed5e5","unresolved":false,"context_lines":[{"line_number":197,"context_line":"                                   \"or ID %s.\" % network)"},{"line_number":198,"context_line":"                ret +\u003d 1"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"        if ret \u003e 0:"},{"line_number":201,"context_line":"            total \u003d len(parsed_args.network)"},{"line_number":202,"context_line":"            msg \u003d \"Failed to delete %s of %s networks.\" % (ret, total)"},{"line_number":203,"context_line":"            raise exceptions.CommandError(msg)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_c9032841","line":200,"range":{"start_line":200,"start_character":11,"end_line":200,"end_character":14},"updated":"2016-03-23 00:58:25.000000000","message":"You can do \n\n if ret:","commit_id":"cad31ad9b774fc553ea131f4153f7c6dce906c92"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"1f005fa89664f933a496826a9d14239705fce393","unresolved":false,"context_lines":[{"line_number":197,"context_line":"                                   \"or ID %s.\" % network)"},{"line_number":198,"context_line":"                ret +\u003d 1"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"        if ret \u003e 0:"},{"line_number":201,"context_line":"            total \u003d len(parsed_args.network)"},{"line_number":202,"context_line":"            msg \u003d \"Failed to delete %s of %s networks.\" % (ret, total)"},{"line_number":203,"context_line":"            raise exceptions.CommandError(msg)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_42052d78","line":200,"range":{"start_line":200,"start_character":11,"end_line":200,"end_character":14},"in_reply_to":"fa0719c6_c9032841","updated":"2016-03-23 09:15:47.000000000","message":"Done","commit_id":"cad31ad9b774fc553ea131f4153f7c6dce906c92"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"31c88ab0337feef11d75155c35297a2e688ed5e5","unresolved":false,"context_lines":[{"line_number":199,"context_line":""},{"line_number":200,"context_line":"        if ret \u003e 0:"},{"line_number":201,"context_line":"            total \u003d len(parsed_args.network)"},{"line_number":202,"context_line":"            msg \u003d \"Failed to delete %s of %s networks.\" % (ret, total)"},{"line_number":203,"context_line":"            raise exceptions.CommandError(msg)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def take_action_compute(self, client, parsed_args):"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_09fec036","line":202,"updated":"2016-03-23 00:58:25.000000000","message":"What I find a bit odd is reporting a not found network as something which we failed to delete.\nFailure to delete may not be mixed with a network which is not found..\nIMHO\n\n\nIdeally we can report the number of networks not found, and the number of networks which we actually failed to delete separately.","commit_id":"cad31ad9b774fc553ea131f4153f7c6dce906c92"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"1f005fa89664f933a496826a9d14239705fce393","unresolved":false,"context_lines":[{"line_number":199,"context_line":""},{"line_number":200,"context_line":"        if ret \u003e 0:"},{"line_number":201,"context_line":"            total \u003d len(parsed_args.network)"},{"line_number":202,"context_line":"            msg \u003d \"Failed to delete %s of %s networks.\" % (ret, total)"},{"line_number":203,"context_line":"            raise exceptions.CommandError(msg)"},{"line_number":204,"context_line":""},{"line_number":205,"context_line":"    def take_action_compute(self, client, parsed_args):"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_82ff4566","line":202,"in_reply_to":"fa0719c6_09fec036","updated":"2016-03-23 09:15:47.000000000","message":"But in compute v2, find_resource() has trapped many exceptions, including NotFound exceptions. It will finally raise an CommandError exception. So I cannot log how many networks not found and failed to delete in compute v2.","commit_id":"cad31ad9b774fc553ea131f4153f7c6dce906c92"},{"author":{"_account_id":8410,"name":"Richard Theis","email":"rtheis@us.ibm.com","username":"rtheis"},"change_message_id":"f61cd8b97af8eb97f1abd8f933356da8c2063192","unresolved":false,"context_lines":[{"line_number":188,"context_line":"            try:"},{"line_number":189,"context_line":"                obj \u003d client.find_network(network, ignore_missing\u003dFalse)"},{"line_number":190,"context_line":"                client.delete_network(obj)"},{"line_number":191,"context_line":"            except openstack_exceptions.ResourceNotFound:"},{"line_number":192,"context_line":"                self.app.log.error(\"No network found with name or ID %s.\""},{"line_number":193,"context_line":"                                   % network)"},{"line_number":194,"context_line":"                ret +\u003d 1"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa0719c6_60928d4d","line":191,"updated":"2016-03-24 13:24:41.000000000","message":"It is nice to know why the resource wasn\u0027t deleted as this exception clearly states.  However the general exception case does not provide details.  Would it be better to just handle a generic exception and include it in the message?\n\nFor example:\n\n\"Failed to delete network \u003cnetwork\u003e: \u003cexception\u003e\"","commit_id":"7fd71590daf36a65785f58bfef0a5583788a3fa8"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"fe4283ccac2116c244bf0af1613e8ca89b58c5bd","unresolved":false,"context_lines":[{"line_number":188,"context_line":"            try:"},{"line_number":189,"context_line":"                obj \u003d client.find_network(network, ignore_missing\u003dFalse)"},{"line_number":190,"context_line":"                client.delete_network(obj)"},{"line_number":191,"context_line":"            except openstack_exceptions.ResourceNotFound:"},{"line_number":192,"context_line":"                self.app.log.error(\"No network found with name or ID %s.\""},{"line_number":193,"context_line":"                                   % network)"},{"line_number":194,"context_line":"                ret +\u003d 1"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a061dce_4beb0adc","line":191,"in_reply_to":"fa0719c6_60928d4d","updated":"2016-04-08 06:31:24.000000000","message":"Done","commit_id":"7fd71590daf36a65785f58bfef0a5583788a3fa8"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"3b8d8f2754e1458f63f969a4e59027c0af11398e","unresolved":false,"context_lines":[{"line_number":199,"context_line":""},{"line_number":200,"context_line":"        if ret:"},{"line_number":201,"context_line":"            total \u003d len(parsed_args.network)"},{"line_number":202,"context_line":"            msg \u003d \"%s of %s networks not found or failed to delete.\" \\"},{"line_number":203,"context_line":"                  % (ret, total)"},{"line_number":204,"context_line":"            raise exceptions.CommandError(msg)"},{"line_number":205,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"fa0719c6_94cf7928","line":202,"range":{"start_line":202,"start_character":19,"end_line":202,"end_character":67},"updated":"2016-03-23 09:31:38.000000000","message":"Hi Reedip,\n\nI changed the commit message like this. :)","commit_id":"7fd71590daf36a65785f58bfef0a5583788a3fa8"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"3b1af308352924a190cc2a1a56840806fbe56108","unresolved":false,"context_lines":[{"line_number":235,"context_line":"            help\u003d(\"Network(s) to delete (name or ID)\")"},{"line_number":236,"context_line":"        )"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"        # Used by base class to find resources in parsed_args."},{"line_number":239,"context_line":"        self.resource \u003d \u0027network\u0027"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"        return parser"},{"line_number":242,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_20b4accf","line":239,"range":{"start_line":238,"start_character":7,"end_line":239,"end_character":33},"updated":"2016-04-13 02:39:24.000000000","message":"the part logic doesn\u0027t matter with updating parser, so a class attribute looks better.","commit_id":"daf1088850e57d4dcf08539257d41dda851388eb"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"9ec1f562d0b41230580da590f388dc940e9fbe54","unresolved":false,"context_lines":[{"line_number":235,"context_line":"            help\u003d(\"Network(s) to delete (name or ID)\")"},{"line_number":236,"context_line":"        )"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"        # Used by base class to find resources in parsed_args."},{"line_number":239,"context_line":"        self.resource \u003d \u0027network\u0027"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"        return parser"},{"line_number":242,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_9f5ddb49","line":239,"range":{"start_line":238,"start_character":7,"end_line":239,"end_character":33},"in_reply_to":"5a18252c_20b4accf","updated":"2016-04-14 06:52:46.000000000","message":"Done","commit_id":"daf1088850e57d4dcf08539257d41dda851388eb"}],"openstackclient/tests/compute/v2/fakes.py":[{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"3b1af308352924a190cc2a1a56840806fbe56108","unresolved":false,"context_lines":[{"line_number":926,"context_line":"            networks"},{"line_number":927,"context_line":"        \"\"\""},{"line_number":928,"context_line":"        if networks is None:"},{"line_number":929,"context_line":"            networks \u003d FakeNetwork.create_networks(count)"},{"line_number":930,"context_line":"        return mock.Mock(side_effect\u003dnetworks)"},{"line_number":931,"context_line":""},{"line_number":932,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_a07d5cb3","line":929,"range":{"start_line":929,"start_character":51,"end_line":929,"end_character":56},"updated":"2016-04-13 02:39:24.000000000","message":"the first argument of FakeNetwork.create_networks() is \"attrs\u003d{}\", so if you want to specify count, use keyword argument at here\n\n    networks \u003d FakeNetwork.create_networks(count\u003dcount)","commit_id":"daf1088850e57d4dcf08539257d41dda851388eb"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"9ec1f562d0b41230580da590f388dc940e9fbe54","unresolved":false,"context_lines":[{"line_number":926,"context_line":"            networks"},{"line_number":927,"context_line":"        \"\"\""},{"line_number":928,"context_line":"        if networks is None:"},{"line_number":929,"context_line":"            networks \u003d FakeNetwork.create_networks(count)"},{"line_number":930,"context_line":"        return mock.Mock(side_effect\u003dnetworks)"},{"line_number":931,"context_line":""},{"line_number":932,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_d96773b5","line":929,"range":{"start_line":929,"start_character":51,"end_line":929,"end_character":56},"in_reply_to":"5a18252c_a07d5cb3","updated":"2016-04-14 06:52:46.000000000","message":"Done","commit_id":"daf1088850e57d4dcf08539257d41dda851388eb"}],"openstackclient/tests/network/v2/test_network.py":[{"author":{"_account_id":8410,"name":"Richard Theis","email":"rtheis@us.ibm.com","username":"rtheis"},"change_message_id":"498e5c97f9bbafe161c0e043c55ad96b104a9a98","unresolved":false,"context_lines":[{"line_number":300,"context_line":""},{"line_number":301,"context_line":"        self.network.delete_network \u003d mock.Mock(return_value\u003dNone)"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"        self.network.find_network \u003d network_fakes.FakeNetwork.get_networks("},{"line_number":304,"context_line":"            networks\u003dself._networks)"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"        # Get the command object to test"}],"source_content_type":"text/x-python","patch_set":3,"id":"1af94dfe_6a43956c","line":303,"updated":"2016-03-18 18:36:37.000000000","message":"This should return a single network to match the code.","commit_id":"d4363b05f1559c403b69734de2a11cd61e784ac8"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"412b8ec7e2ceea4aaabcc58929495984f4a3aa15","unresolved":false,"context_lines":[{"line_number":300,"context_line":""},{"line_number":301,"context_line":"        self.network.delete_network \u003d mock.Mock(return_value\u003dNone)"},{"line_number":302,"context_line":""},{"line_number":303,"context_line":"        self.network.find_network \u003d network_fakes.FakeNetwork.get_networks("},{"line_number":304,"context_line":"            networks\u003dself._networks)"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"        # Get the command object to test"}],"source_content_type":"text/x-python","patch_set":3,"id":"1af94dfe_f6bf82cd","line":303,"in_reply_to":"1af94dfe_6a43956c","updated":"2016-03-19 02:06:14.000000000","message":"get_networks() will return a Mock with side_effect is a list of networks, which means it will return one single network each time find_network() is called. So I think it is correct here.","commit_id":"d4363b05f1559c403b69734de2a11cd61e784ac8"},{"author":{"_account_id":8410,"name":"Richard Theis","email":"rtheis@us.ibm.com","username":"rtheis"},"change_message_id":"498e5c97f9bbafe161c0e043c55ad96b104a9a98","unresolved":false,"context_lines":[{"line_number":317,"context_line":""},{"line_number":318,"context_line":"        result \u003d self.cmd.take_action(parsed_args)"},{"line_number":319,"context_line":""},{"line_number":320,"context_line":"        self.network.delete_network.assert_called_with(self._networks[0])"},{"line_number":321,"context_line":"        self.assertIsNone(result)"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":"    def test_delete_multi_network(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1af94dfe_ea57a523","line":320,"updated":"2016-03-18 18:36:37.000000000","message":"Use assert_called_once_with().","commit_id":"d4363b05f1559c403b69734de2a11cd61e784ac8"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"412b8ec7e2ceea4aaabcc58929495984f4a3aa15","unresolved":false,"context_lines":[{"line_number":317,"context_line":""},{"line_number":318,"context_line":"        result \u003d self.cmd.take_action(parsed_args)"},{"line_number":319,"context_line":""},{"line_number":320,"context_line":"        self.network.delete_network.assert_called_with(self._networks[0])"},{"line_number":321,"context_line":"        self.assertIsNone(result)"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":"    def test_delete_multi_network(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1af94dfe_96d1de25","line":320,"in_reply_to":"1af94dfe_ea57a523","updated":"2016-03-19 02:06:14.000000000","message":"Done","commit_id":"d4363b05f1559c403b69734de2a11cd61e784ac8"},{"author":{"_account_id":8410,"name":"Richard Theis","email":"rtheis@us.ibm.com","username":"rtheis"},"change_message_id":"498e5c97f9bbafe161c0e043c55ad96b104a9a98","unresolved":false,"context_lines":[{"line_number":367,"context_line":"        self.assertRaises(exceptions.CommandError, self.cmd.take_action,"},{"line_number":368,"context_line":"                          parsed_args)"},{"line_number":369,"context_line":""},{"line_number":370,"context_line":"        # The second call of find_network() should fail. So delete_network()"},{"line_number":371,"context_line":"        # was only called twice."},{"line_number":372,"context_line":"        calls \u003d ["},{"line_number":373,"context_line":"            call(self._networks[0]),"}],"source_content_type":"text/x-python","patch_set":3,"id":"1af94dfe_5e02da0a","line":370,"updated":"2016-03-18 18:36:37.000000000","message":"The code should continue.  Why doesn\u0027t the unit test match?","commit_id":"d4363b05f1559c403b69734de2a11cd61e784ac8"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"412b8ec7e2ceea4aaabcc58929495984f4a3aa15","unresolved":false,"context_lines":[{"line_number":367,"context_line":"        self.assertRaises(exceptions.CommandError, self.cmd.take_action,"},{"line_number":368,"context_line":"                          parsed_args)"},{"line_number":369,"context_line":""},{"line_number":370,"context_line":"        # The second call of find_network() should fail. So delete_network()"},{"line_number":371,"context_line":"        # was only called twice."},{"line_number":372,"context_line":"        calls \u003d ["},{"line_number":373,"context_line":"            call(self._networks[0]),"}],"source_content_type":"text/x-python","patch_set":3,"id":"1af94dfe_f68dc231","line":370,"in_reply_to":"1af94dfe_5e02da0a","updated":"2016-03-19 02:06:14.000000000","message":"Sorry, I don\u0027t quite understand. The code is:\n\ntry:\n    obj \u003d client.find_network(network, ignore_missing\u003dFalse)\n    client.delete_network(obj)\nexcept XXX:\n    ......\n\nIf find_network() failed, delete_network() won\u0027t be called since it depends on the result of find_network().\n\nIn this unit test, I tried to delete 3 networks, with the second one not found. So delete_network() will only be called twice.","commit_id":"d4363b05f1559c403b69734de2a11cd61e784ac8"},{"author":{"_account_id":8410,"name":"Richard Theis","email":"rtheis@us.ibm.com","username":"rtheis"},"change_message_id":"498e5c97f9bbafe161c0e043c55ad96b104a9a98","unresolved":false,"context_lines":[{"line_number":832,"context_line":"        self.assertRaises(exceptions.CommandError, self.cmd.take_action,"},{"line_number":833,"context_line":"                          parsed_args)"},{"line_number":834,"context_line":""},{"line_number":835,"context_line":"        # The second call of utils.find_resource() should fail. So delete()"},{"line_number":836,"context_line":"        # was only called twice."},{"line_number":837,"context_line":"        calls \u003d ["},{"line_number":838,"context_line":"            call(self._networks[0].id),"}],"source_content_type":"text/x-python","patch_set":3,"id":"1af94dfe_fe176642","line":835,"updated":"2016-03-18 18:36:37.000000000","message":"The code should continue.  Why doesn\u0027t the unit test match?","commit_id":"d4363b05f1559c403b69734de2a11cd61e784ac8"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"31c88ab0337feef11d75155c35297a2e688ed5e5","unresolved":false,"context_lines":[{"line_number":320,"context_line":"        self.network.delete_network.assert_called_once_with(self._networks[0])"},{"line_number":321,"context_line":"        self.assertIsNone(result)"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":"    def test_delete_multi_network(self):"},{"line_number":324,"context_line":"        arglist \u003d []"},{"line_number":325,"context_line":"        verifylist \u003d []"},{"line_number":326,"context_line":"        for n in self._networks:"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_89b77085","line":323,"updated":"2016-03-23 00:58:25.000000000","message":"can we rewrite it as multiple network ?\nMulti_network does not fit the situation","commit_id":"cad31ad9b774fc553ea131f4153f7c6dce906c92"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"1f005fa89664f933a496826a9d14239705fce393","unresolved":false,"context_lines":[{"line_number":320,"context_line":"        self.network.delete_network.assert_called_once_with(self._networks[0])"},{"line_number":321,"context_line":"        self.assertIsNone(result)"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":"    def test_delete_multi_network(self):"},{"line_number":324,"context_line":"        arglist \u003d []"},{"line_number":325,"context_line":"        verifylist \u003d []"},{"line_number":326,"context_line":"        for n in self._networks:"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_02ddf50d","line":323,"in_reply_to":"fa0719c6_89b77085","updated":"2016-03-23 09:15:47.000000000","message":"Done","commit_id":"cad31ad9b774fc553ea131f4153f7c6dce906c92"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"3b1af308352924a190cc2a1a56840806fbe56108","unresolved":false,"context_lines":[{"line_number":352,"context_line":""},{"line_number":353,"context_line":"    def test_delete_multiple_networks(self):"},{"line_number":354,"context_line":"        arglist \u003d []"},{"line_number":355,"context_line":"        verifylist \u003d []"},{"line_number":356,"context_line":"        for n in self._networks:"},{"line_number":357,"context_line":"            arglist.append(n.id)"},{"line_number":358,"context_line":"        verifylist \u003d ["}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_e39e3eb7","line":355,"range":{"start_line":355,"start_character":8,"end_line":355,"end_character":23},"updated":"2016-04-13 02:39:24.000000000","message":"\"verifylist\" is assigned in the following logic again, the line isn\u0027t used.","commit_id":"daf1088850e57d4dcf08539257d41dda851388eb"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"9ec1f562d0b41230580da590f388dc940e9fbe54","unresolved":false,"context_lines":[{"line_number":352,"context_line":""},{"line_number":353,"context_line":"    def test_delete_multiple_networks(self):"},{"line_number":354,"context_line":"        arglist \u003d []"},{"line_number":355,"context_line":"        verifylist \u003d []"},{"line_number":356,"context_line":"        for n in self._networks:"},{"line_number":357,"context_line":"            arglist.append(n.id)"},{"line_number":358,"context_line":"        verifylist \u003d ["}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_390787cb","line":355,"range":{"start_line":355,"start_character":8,"end_line":355,"end_character":23},"in_reply_to":"5a18252c_e39e3eb7","updated":"2016-04-14 06:52:46.000000000","message":"Done","commit_id":"daf1088850e57d4dcf08539257d41dda851388eb"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"3b1af308352924a190cc2a1a56840806fbe56108","unresolved":false,"context_lines":[{"line_number":821,"context_line":""},{"line_number":822,"context_line":"    def test_delete_multiple_networks(self):"},{"line_number":823,"context_line":"        arglist \u003d []"},{"line_number":824,"context_line":"        verifylist \u003d []"},{"line_number":825,"context_line":"        for n in self._networks:"},{"line_number":826,"context_line":"            arglist.append(n.label)"},{"line_number":827,"context_line":"        verifylist \u003d ["}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_c3f3429d","line":824,"range":{"start_line":824,"start_character":8,"end_line":824,"end_character":23},"updated":"2016-04-13 02:39:24.000000000","message":"ditto","commit_id":"daf1088850e57d4dcf08539257d41dda851388eb"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"9ec1f562d0b41230580da590f388dc940e9fbe54","unresolved":false,"context_lines":[{"line_number":821,"context_line":""},{"line_number":822,"context_line":"    def test_delete_multiple_networks(self):"},{"line_number":823,"context_line":"        arglist \u003d []"},{"line_number":824,"context_line":"        verifylist \u003d []"},{"line_number":825,"context_line":"        for n in self._networks:"},{"line_number":826,"context_line":"            arglist.append(n.label)"},{"line_number":827,"context_line":"        verifylist \u003d ["}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_190c4bec","line":824,"range":{"start_line":824,"start_character":8,"end_line":824,"end_character":23},"in_reply_to":"5a18252c_c3f3429d","updated":"2016-04-14 06:52:46.000000000","message":"Done","commit_id":"daf1088850e57d4dcf08539257d41dda851388eb"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"3b1af308352924a190cc2a1a56840806fbe56108","unresolved":false,"context_lines":[{"line_number":852,"context_line":"        # In compute v2, we use utils.find_resource() to find a network."},{"line_number":853,"context_line":"        # It calls get() several times, but find() only one time. So we"},{"line_number":854,"context_line":"        # choose to fake get() always raise exception, then pass through."},{"line_number":855,"context_line":"        # And fake find() to find the real network or not."},{"line_number":856,"context_line":"        self.compute.networks.get.side_effect \u003d Exception()"},{"line_number":857,"context_line":"        ret_find \u003d ["},{"line_number":858,"context_line":"            self._networks[0],"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_e37c7eed","line":855,"updated":"2016-04-13 02:39:24.000000000","message":"nice clarification :-)","commit_id":"daf1088850e57d4dcf08539257d41dda851388eb"},{"author":{"_account_id":14937,"name":"Tang Chen","email":"imtangchen@163.com","username":"tangchen"},"change_message_id":"9ec1f562d0b41230580da590f388dc940e9fbe54","unresolved":false,"context_lines":[{"line_number":852,"context_line":"        # In compute v2, we use utils.find_resource() to find a network."},{"line_number":853,"context_line":"        # It calls get() several times, but find() only one time. So we"},{"line_number":854,"context_line":"        # choose to fake get() always raise exception, then pass through."},{"line_number":855,"context_line":"        # And fake find() to find the real network or not."},{"line_number":856,"context_line":"        self.compute.networks.get.side_effect \u003d Exception()"},{"line_number":857,"context_line":"        ret_find \u003d ["},{"line_number":858,"context_line":"            self._networks[0],"}],"source_content_type":"text/x-python","patch_set":11,"id":"5a18252c_5912430a","line":855,"in_reply_to":"5a18252c_e37c7eed","updated":"2016-04-14 06:52:46.000000000","message":"Thx. :)","commit_id":"daf1088850e57d4dcf08539257d41dda851388eb"}]}
