)]}'
{"tempest/api/network/base.py":[{"author":{"_account_id":7428,"name":"Yaroslav Lobankov","email":"lobankovyv@gmail.com","username":"ylobankov"},"change_message_id":"9a7625a5cbeffcbd717790849cbd27e234fb0e62","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                    floating_ip[\u0027id\u0027])"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"            # Clean up metering label rules"},{"line_number":101,"context_line":"            if len(cls.metering_label_rules) \u003e 0:"},{"line_number":102,"context_line":"                label_rules_client \u003d cls.admin_metering_label_rules_client"},{"line_number":103,"context_line":"            for metering_label_rule in cls.metering_label_rules:"},{"line_number":104,"context_line":"                cls._try_delete_resource("}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_70a025a0","line":101,"updated":"2015-12-04 17:41:02.000000000","message":"Could you please explain why do you add this \"if\"? It looks like it is redundant.","commit_id":"47d893a55f3adab1c33274346dcf55be8ceca84e"},{"author":{"_account_id":8001,"name":"John Warren","email":"jswarren@us.ibm.com","username":"jswarren"},"change_message_id":"f4f420bd23d5497a1b9c15a2595363c38d212327","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                    floating_ip[\u0027id\u0027])"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"            # Clean up metering label rules"},{"line_number":101,"context_line":"            if len(cls.metering_label_rules) \u003e 0:"},{"line_number":102,"context_line":"                label_rules_client \u003d cls.admin_metering_label_rules_client"},{"line_number":103,"context_line":"            for metering_label_rule in cls.metering_label_rules:"},{"line_number":104,"context_line":"                cls._try_delete_resource("}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_d221d9b5","line":101,"in_reply_to":"7a740942_37de0f12","updated":"2015-12-04 20:39:25.000000000","message":"Yaroslav, thanks for the suggestion.  While your change is technically correct, I\u0027m not convinced that it would not make the code less readable by having a single function parameter span multiple lines.  However, I\u0027m not opposed to changing it if consensus holds that it would be better as you suggest.","commit_id":"47d893a55f3adab1c33274346dcf55be8ceca84e"},{"author":{"_account_id":8001,"name":"John Warren","email":"jswarren@us.ibm.com","username":"jswarren"},"change_message_id":"bd2ad3bc51a3c2d3df7c016cd9097f5be4327516","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                    floating_ip[\u0027id\u0027])"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"            # Clean up metering label rules"},{"line_number":101,"context_line":"            if len(cls.metering_label_rules) \u003e 0:"},{"line_number":102,"context_line":"                label_rules_client \u003d cls.admin_metering_label_rules_client"},{"line_number":103,"context_line":"            for metering_label_rule in cls.metering_label_rules:"},{"line_number":104,"context_line":"                cls._try_delete_resource("}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_a1163def","line":101,"in_reply_to":"7a740942_70a025a0","updated":"2015-12-04 19:00:11.000000000","message":"It\u0027s complicated...  If you look at patch set 1, you\u0027ll see that the conditional is not there and several neutron test cases failed as a result.  The reason they failed is because BaseNetworkTest does not have an \"admin_metering_label_rules_client\" class variable--only some descendant classes do.  One way of checking to see if the class variable exists is to see whether any metering label rules were created, which is essentially how the code worked before.  The reason for adding the local variable at all is to reduce the length of line 105.  This could arguably be done within the \"for\" loop, but there is no reason to set this variable to the same value over and over.  In other words, putting it into the \"for\" loop would give the false impression that the value of the variable changes during each iteration of the loop.  If I were writing this code from scratch, I would move all of the metering-label-related logic to the class that actually has the admin_metering_label_rules_client class variable instead of having it here, but the scope of this change is simply to refactor the neutron client--in other words, moving it would arguably not be appropriate in the context of this change.  There may also be other reasons why the logic was put here instead of a descendant class.","commit_id":"47d893a55f3adab1c33274346dcf55be8ceca84e"},{"author":{"_account_id":8001,"name":"John Warren","email":"jswarren@us.ibm.com","username":"jswarren"},"change_message_id":"57e23a8ebc631d866cafaf99f35947142e17c884","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                    floating_ip[\u0027id\u0027])"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"            # Clean up metering label rules"},{"line_number":101,"context_line":"            if len(cls.metering_label_rules) \u003e 0:"},{"line_number":102,"context_line":"                label_rules_client \u003d cls.admin_metering_label_rules_client"},{"line_number":103,"context_line":"            for metering_label_rule in cls.metering_label_rules:"},{"line_number":104,"context_line":"                cls._try_delete_resource("}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_1730b000","line":101,"in_reply_to":"7a740942_97e7c0e3","updated":"2015-12-04 21:41:52.000000000","message":"Fair enough. :)  Comment added.","commit_id":"47d893a55f3adab1c33274346dcf55be8ceca84e"},{"author":{"_account_id":7428,"name":"Yaroslav Lobankov","email":"lobankovyv@gmail.com","username":"ylobankov"},"change_message_id":"05cf15f2d57ee1947da040f0edd12597dbb73843","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                    floating_ip[\u0027id\u0027])"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"            # Clean up metering label rules"},{"line_number":101,"context_line":"            if len(cls.metering_label_rules) \u003e 0:"},{"line_number":102,"context_line":"                label_rules_client \u003d cls.admin_metering_label_rules_client"},{"line_number":103,"context_line":"            for metering_label_rule in cls.metering_label_rules:"},{"line_number":104,"context_line":"                cls._try_delete_resource("}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_37de0f12","line":101,"in_reply_to":"7a740942_a1163def","updated":"2015-12-04 19:58:57.000000000","message":"Jhon, thank you for very detailed answer :) But I believe you could use\n\n    cls._try_delete_resource(\n        cls.admin_metering_label_rules_client\n        .delete_metering_label_rule,\n        metering_label_rule[\u0027id\u0027])","commit_id":"47d893a55f3adab1c33274346dcf55be8ceca84e"},{"author":{"_account_id":7428,"name":"Yaroslav Lobankov","email":"lobankovyv@gmail.com","username":"ylobankov"},"change_message_id":"a5099da7a1b4abb83ac9d6091dc2bb77a221d970","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                    floating_ip[\u0027id\u0027])"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"            # Clean up metering label rules"},{"line_number":101,"context_line":"            if len(cls.metering_label_rules) \u003e 0:"},{"line_number":102,"context_line":"                label_rules_client \u003d cls.admin_metering_label_rules_client"},{"line_number":103,"context_line":"            for metering_label_rule in cls.metering_label_rules:"},{"line_number":104,"context_line":"                cls._try_delete_resource("}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_97e7c0e3","line":101,"in_reply_to":"7a740942_d221d9b5","updated":"2015-12-04 21:30:42.000000000","message":"I am OK with this \"if\". But it would be very nice to have a small comment describing the purpose of this.","commit_id":"47d893a55f3adab1c33274346dcf55be8ceca84e"}]}
