)]}'
{"nova/virt/ironic/driver.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"9b1c896f4280cffbbeda2673a84f62308540b8c7","unresolved":false,"context_lines":[{"line_number":178,"context_line":"        good_provision_states \u003d ["},{"line_number":179,"context_line":"            ironic_states.AVAILABLE, ironic_states.NOSTATE]"},{"line_number":180,"context_line":"        # NOTE(zhenguo): Node\u0027s resources should not be exposed to Nova"},{"line_number":181,"context_line":"        # if there\u0027s no any port associated with it."},{"line_number":182,"context_line":"        ports \u003d self.ironicclient.call(\"node.list_ports\", node_obj.uuid)"},{"line_number":183,"context_line":"        return (node_obj.maintenance or"},{"line_number":184,"context_line":"                node_obj.power_state in bad_power_states or"}],"source_content_type":"text/x-python","patch_set":1,"id":"bab6814e_f677dfff","line":181,"range":{"start_line":181,"start_character":24,"end_line":181,"end_character":28},"updated":"2016-05-25 17:25:12.000000000","message":"s/any //","commit_id":"770f3a20709742aabf971c15d9e6e493b307fdfa"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"8934d73854254dd8206744c0d1b9aae204ca8332","unresolved":false,"context_lines":[{"line_number":184,"context_line":"                node_obj.power_state in bad_power_states or"},{"line_number":185,"context_line":"                node_obj.provision_state not in good_provision_states or"},{"line_number":186,"context_line":"                (node_obj.provision_state in good_provision_states and"},{"line_number":187,"context_line":"                 node_obj.instance_uuid is not None) or not ports)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def _node_resources_used(self, node_obj):"},{"line_number":190,"context_line":"        \"\"\"Determine whether the node\u0027s resources are currently used."}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_46ce7684","line":187,"updated":"2016-06-21 18:01:22.000000000","message":"This return statement looks very complex, can we break it down please?","commit_id":"53c7a6b8289d1f6139bb2903d842b5935ffafbcc"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"2a14d29d0bb3c002ffae4a7f078a720669c4a0fd","unresolved":false,"context_lines":[{"line_number":184,"context_line":"                node_obj.power_state in bad_power_states or"},{"line_number":185,"context_line":"                node_obj.provision_state not in good_provision_states or"},{"line_number":186,"context_line":"                (node_obj.provision_state in good_provision_states and"},{"line_number":187,"context_line":"                 node_obj.instance_uuid is not None) or not ports)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def _node_resources_used(self, node_obj):"},{"line_number":190,"context_line":"        \"\"\"Determine whether the node\u0027s resources are currently used."}],"source_content_type":"text/x-python","patch_set":5,"id":"1aa78d24_d39ba816","line":187,"in_reply_to":"1aa78d24_02cde0b6","updated":"2016-07-06 13:51:26.000000000","message":"@Zhenguo sure, my comment was mostly a suggestion. But looking at John\u0027s suggestion it seems more readable indeed.","commit_id":"53c7a6b8289d1f6139bb2903d842b5935ffafbcc"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"d8f0c5e5b92c598231e89f8ae9ad0a07952c7016","unresolved":false,"context_lines":[{"line_number":184,"context_line":"                node_obj.power_state in bad_power_states or"},{"line_number":185,"context_line":"                node_obj.provision_state not in good_provision_states or"},{"line_number":186,"context_line":"                (node_obj.provision_state in good_provision_states and"},{"line_number":187,"context_line":"                 node_obj.instance_uuid is not None) or not ports)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def _node_resources_used(self, node_obj):"},{"line_number":190,"context_line":"        \"\"\"Determine whether the node\u0027s resources are currently used."}],"source_content_type":"text/x-python","patch_set":5,"id":"1aa78d24_02cde0b6","line":187,"in_reply_to":"1aa78d24_768f542a","updated":"2016-07-06 12:56:04.000000000","message":"Personally I like John\u0027s idea since it makes it far more readable and easier to parse each specific condition.","commit_id":"53c7a6b8289d1f6139bb2903d842b5935ffafbcc"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"1d04196f9f270460f7149e9769944f736faaf3a7","unresolved":false,"context_lines":[{"line_number":184,"context_line":"                node_obj.power_state in bad_power_states or"},{"line_number":185,"context_line":"                node_obj.provision_state not in good_provision_states or"},{"line_number":186,"context_line":"                (node_obj.provision_state in good_provision_states and"},{"line_number":187,"context_line":"                 node_obj.instance_uuid is not None) or not ports)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def _node_resources_used(self, node_obj):"},{"line_number":190,"context_line":"        \"\"\"Determine whether the node\u0027s resources are currently used."}],"source_content_type":"text/x-python","patch_set":5,"id":"1aa78d24_f9ea030e","line":187,"in_reply_to":"1aa78d24_d39ba816","updated":"2016-07-06 14:15:17.000000000","message":"OK, will update soon!","commit_id":"53c7a6b8289d1f6139bb2903d842b5935ffafbcc"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"42f60d5bf8146d22452e21061056691e08a95ee2","unresolved":false,"context_lines":[{"line_number":184,"context_line":"                node_obj.power_state in bad_power_states or"},{"line_number":185,"context_line":"                node_obj.provision_state not in good_provision_states or"},{"line_number":186,"context_line":"                (node_obj.provision_state in good_provision_states and"},{"line_number":187,"context_line":"                 node_obj.instance_uuid is not None) or not ports)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def _node_resources_used(self, node_obj):"},{"line_number":190,"context_line":"        \"\"\"Determine whether the node\u0027s resources are currently used."}],"source_content_type":"text/x-python","patch_set":5,"id":"1aa78d24_768f542a","line":187,"in_reply_to":"3aaa91ec_1ebab56e","updated":"2016-07-06 09:03:14.000000000","message":"Thanks John for the suggestion, @Lucas, do you think that would be better or just keep it as is?","commit_id":"53c7a6b8289d1f6139bb2903d842b5935ffafbcc"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"3d429ffe326c7992119c22b2d2ccb872bbb30ab8","unresolved":false,"context_lines":[{"line_number":184,"context_line":"                node_obj.power_state in bad_power_states or"},{"line_number":185,"context_line":"                node_obj.provision_state not in good_provision_states or"},{"line_number":186,"context_line":"                (node_obj.provision_state in good_provision_states and"},{"line_number":187,"context_line":"                 node_obj.instance_uuid is not None) or not ports)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def _node_resources_used(self, node_obj):"},{"line_number":190,"context_line":"        \"\"\"Determine whether the node\u0027s resources are currently used."}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_1ebab56e","line":187,"in_reply_to":"3aaa91ec_3effb168","updated":"2016-06-22 16:14:04.000000000","message":"Not sure how ugly this is but maybe:\n\n if node_obj.maintenance:\n    return True\n if node_obj.power_state in bad_power_states:\n    return True\n ....\n if not ports:\n    return True\n return False","commit_id":"53c7a6b8289d1f6139bb2903d842b5935ffafbcc"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"9f7bf198f1a052ac0ff87eec889facdac3578801","unresolved":false,"context_lines":[{"line_number":184,"context_line":"                node_obj.power_state in bad_power_states or"},{"line_number":185,"context_line":"                node_obj.provision_state not in good_provision_states or"},{"line_number":186,"context_line":"                (node_obj.provision_state in good_provision_states and"},{"line_number":187,"context_line":"                 node_obj.instance_uuid is not None) or not ports)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def _node_resources_used(self, node_obj):"},{"line_number":190,"context_line":"        \"\"\"Determine whether the node\u0027s resources are currently used."}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_3effb168","line":187,"in_reply_to":"3aaa91ec_46ce7684","updated":"2016-06-22 16:07:22.000000000","message":"Sorry Lucas, I tried to break the statement down, but not find a good way, it\u0027s complex as there\u0027s really many conditions should be considered in unavailable state, do you have any suggestion?","commit_id":"53c7a6b8289d1f6139bb2903d842b5935ffafbcc"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"ee7332902c7c0189900da086df88119533bcb623","unresolved":false,"context_lines":[{"line_number":184,"context_line":"                node_obj.power_state in bad_power_states or"},{"line_number":185,"context_line":"                node_obj.provision_state not in good_provision_states or"},{"line_number":186,"context_line":"                (node_obj.provision_state in good_provision_states and"},{"line_number":187,"context_line":"                 node_obj.instance_uuid is not None) or not ports)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def _node_resources_used(self, node_obj):"},{"line_number":190,"context_line":"        \"\"\"Determine whether the node\u0027s resources are currently used."}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_784cb142","line":187,"in_reply_to":"3aaa91ec_46ce7684","updated":"2016-06-22 15:33:14.000000000","message":"Thanks Lucas, will update in the coming patch set.","commit_id":"53c7a6b8289d1f6139bb2903d842b5935ffafbcc"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"59780ca7885539b741b3ad69fc1d3d640565c781","unresolved":false,"context_lines":[{"line_number":187,"context_line":"            return True"},{"line_number":188,"context_line":"        if node_obj.provision_state not in good_provision_states:"},{"line_number":189,"context_line":"            return True"},{"line_number":190,"context_line":"        if (node_obj.provision_state in good_provision_states and"},{"line_number":191,"context_line":"            node_obj.instance_uuid is not None):"},{"line_number":192,"context_line":"            return True"},{"line_number":193,"context_line":"        if not ports:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1aa78d24_f175f2f9","line":190,"range":{"start_line":190,"start_character":12,"end_line":190,"end_character":61},"updated":"2016-07-06 16:53:16.000000000","message":"We could use \"elif\" for the conditionals here to make it even simple.\n\nFor example, the if above (L188) already tests if provision_state is not in the good_provision_states, so we don\u0027t need to test it again (L190) because we know the state is there.","commit_id":"e580c970c06282840668e491ab7319a022a99530"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"59780ca7885539b741b3ad69fc1d3d640565c781","unresolved":false,"context_lines":[{"line_number":192,"context_line":"            return True"},{"line_number":193,"context_line":"        if not ports:"},{"line_number":194,"context_line":"            return True"},{"line_number":195,"context_line":"        return False"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    def _node_resources_used(self, node_obj):"},{"line_number":198,"context_line":"        \"\"\"Determine whether the node\u0027s resources are currently used."}],"source_content_type":"text/x-python","patch_set":6,"id":"1aa78d24_51eb2678","line":195,"updated":"2016-07-06 16:53:16.000000000","message":"May I suggest:\n\n if node_obj.maintenance:\n     return True\n elif node_obj.power_state in bad_power_states:\n     return True\n elif node_obj.provision_state not in good_provision_states:\n     return True\n elif node_obj.instance_uuid is not None:\n     return True\n elif not ports:\n     return True\n \n return False","commit_id":"e580c970c06282840668e491ab7319a022a99530"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"5247450cd305d4f23bc35a2e7fb578d25250d89b","unresolved":false,"context_lines":[{"line_number":192,"context_line":"            return True"},{"line_number":193,"context_line":"        if not ports:"},{"line_number":194,"context_line":"            return True"},{"line_number":195,"context_line":"        return False"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    def _node_resources_used(self, node_obj):"},{"line_number":198,"context_line":"        \"\"\"Determine whether the node\u0027s resources are currently used."}],"source_content_type":"text/x-python","patch_set":6,"id":"1aa78d24_c8fd936f","line":195,"in_reply_to":"1aa78d24_51eb2678","updated":"2016-07-07 02:59:37.000000000","message":"Done","commit_id":"e580c970c06282840668e491ab7319a022a99530"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"76c6e3abd07341bcf89c388702ac947215fd6210","unresolved":false,"context_lines":[{"line_number":183,"context_line":""},{"line_number":184,"context_line":"        if node_obj.maintenance:"},{"line_number":185,"context_line":"            return True"},{"line_number":186,"context_line":"        elif node_obj.power_state in bad_power_states:"},{"line_number":187,"context_line":"            return True"},{"line_number":188,"context_line":"        elif node_obj.provision_state not in good_provision_states:"},{"line_number":189,"context_line":"            return True"}],"source_content_type":"text/x-python","patch_set":7,"id":"1aa78d24_dab9997b","line":186,"range":{"start_line":186,"start_character":7,"end_line":186,"end_character":12},"updated":"2016-07-07 23:14:50.000000000","message":"Don\u0027t need \u0027elif\u0027 just \u0027if\u0027 as it does a return before.\n\nIf there is a return there is no need for \u0027elif\u0027\n\nAnd I see it was suggested to use \u0027elif\u0027, but I don\u0027t see a need.","commit_id":"938bcb918b5de4626768e37ac35a432808a7c1dd"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"4c4743cf1f44d14674b275ceb3069a218ea63596","unresolved":false,"context_lines":[{"line_number":183,"context_line":""},{"line_number":184,"context_line":"        if node_obj.maintenance:"},{"line_number":185,"context_line":"            return True"},{"line_number":186,"context_line":"        elif node_obj.power_state in bad_power_states:"},{"line_number":187,"context_line":"            return True"},{"line_number":188,"context_line":"        elif node_obj.provision_state not in good_provision_states:"},{"line_number":189,"context_line":"            return True"}],"source_content_type":"text/x-python","patch_set":7,"id":"1aa78d24_741cf9c1","line":186,"range":{"start_line":186,"start_character":7,"end_line":186,"end_character":12},"in_reply_to":"1aa78d24_dab9997b","updated":"2016-07-08 01:22:58.000000000","message":"++","commit_id":"938bcb918b5de4626768e37ac35a432808a7c1dd"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"76c6e3abd07341bcf89c388702ac947215fd6210","unresolved":false,"context_lines":[{"line_number":185,"context_line":"            return True"},{"line_number":186,"context_line":"        elif node_obj.power_state in bad_power_states:"},{"line_number":187,"context_line":"            return True"},{"line_number":188,"context_line":"        elif node_obj.provision_state not in good_provision_states:"},{"line_number":189,"context_line":"            return True"},{"line_number":190,"context_line":"        elif node_obj.instance_uuid is not None:"},{"line_number":191,"context_line":"            return True"}],"source_content_type":"text/x-python","patch_set":7,"id":"1aa78d24_1aacc134","line":188,"updated":"2016-07-07 23:14:50.000000000","message":"Ditto","commit_id":"938bcb918b5de4626768e37ac35a432808a7c1dd"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"76c6e3abd07341bcf89c388702ac947215fd6210","unresolved":false,"context_lines":[{"line_number":187,"context_line":"            return True"},{"line_number":188,"context_line":"        elif node_obj.provision_state not in good_provision_states:"},{"line_number":189,"context_line":"            return True"},{"line_number":190,"context_line":"        elif node_obj.instance_uuid is not None:"},{"line_number":191,"context_line":"            return True"},{"line_number":192,"context_line":"        elif not ports:"},{"line_number":193,"context_line":"            return True"}],"source_content_type":"text/x-python","patch_set":7,"id":"1aa78d24_5aa64954","line":190,"updated":"2016-07-07 23:14:50.000000000","message":"Ditto","commit_id":"938bcb918b5de4626768e37ac35a432808a7c1dd"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"76c6e3abd07341bcf89c388702ac947215fd6210","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            return True"},{"line_number":190,"context_line":"        elif node_obj.instance_uuid is not None:"},{"line_number":191,"context_line":"            return True"},{"line_number":192,"context_line":"        elif not ports:"},{"line_number":193,"context_line":"            return True"},{"line_number":194,"context_line":"        return False"},{"line_number":195,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1aa78d24_ba612d14","line":192,"updated":"2016-07-07 23:14:50.000000000","message":"Ditto","commit_id":"938bcb918b5de4626768e37ac35a432808a7c1dd"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"db24b7b0fc2fea707345b31003128914938f5502","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            return True"},{"line_number":190,"context_line":"        if node_obj.instance_uuid is not None:"},{"line_number":191,"context_line":"            return True"},{"line_number":192,"context_line":"        if not ports:"},{"line_number":193,"context_line":"            return True"},{"line_number":194,"context_line":"        return False"},{"line_number":195,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"dada55a8_ff8a9e19","line":192,"updated":"2016-07-21 18:58:44.000000000","message":"I\u0027d prefer if you made the call to node.list_ports here, to avoid making the call if we don\u0027t need to.","commit_id":"d432cd572a10f2db6c05312d091b7fd49b37c28e"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"b2c1849797a11fa19ac728870b310868f8515b29","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            return True"},{"line_number":190,"context_line":"        if node_obj.instance_uuid is not None:"},{"line_number":191,"context_line":"            return True"},{"line_number":192,"context_line":"        if not ports:"},{"line_number":193,"context_line":"            return True"},{"line_number":194,"context_line":"        return False"},{"line_number":195,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"dada55a8_1e7a0224","line":192,"in_reply_to":"dada55a8_ff8a9e19","updated":"2016-07-22 05:28:51.000000000","message":"Done","commit_id":"d432cd572a10f2db6c05312d091b7fd49b37c28e"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"6f3b8fdf76d9d47adad6eb569244a59456218b35","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        Determines whether the node\u0027s resources should be presented"},{"line_number":170,"context_line":"        to Nova for use based on the current power, provision and maintenance"},{"line_number":171,"context_line":"        state. This is called after _node_resources_used, so any node that"},{"line_number":172,"context_line":"        is not used and not in AVAILABLE should be considered in a \u0027bad\u0027 state,"},{"line_number":173,"context_line":"        and unavailable for scheduling. Returns True if unacceptable."},{"line_number":174,"context_line":"        \"\"\""},{"line_number":175,"context_line":"        bad_power_states \u003d ["}],"source_content_type":"text/x-python","patch_set":10,"id":"bacf61ea_c4ed21f1","line":172,"updated":"2016-08-02 18:23:19.000000000","message":"Please add to the docstring an indication that if the node has no ports, this function will return False.","commit_id":"53da4af6d64f4fc01348cdc4ece34e4f2adbd1fe"},{"author":{"_account_id":8125,"name":"Michael Davies","email":"michael@the-davies.net","username":"mrda"},"change_message_id":"44eb1120a85baca6aa591866b95a71139f946149","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        Determines whether the node\u0027s resources should be presented"},{"line_number":170,"context_line":"        to Nova for use based on the current power, provision and maintenance"},{"line_number":171,"context_line":"        state. This is called after _node_resources_used, so any node that"},{"line_number":172,"context_line":"        is not used and not in AVAILABLE should be considered in a \u0027bad\u0027 state,"},{"line_number":173,"context_line":"        and unavailable for scheduling. Returns True if unacceptable."},{"line_number":174,"context_line":"        \"\"\""},{"line_number":175,"context_line":"        bad_power_states \u003d ["}],"source_content_type":"text/x-python","patch_set":10,"id":"5a74a57a_20ba31c1","line":172,"in_reply_to":"bacf61ea_c4ed21f1","updated":"2016-11-30 05:30:43.000000000","message":"+1 Agree that should be documented here","commit_id":"53da4af6d64f4fc01348cdc4ece34e4f2adbd1fe"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"45f786e964cf1488105c8286efda52ff533c1917","unresolved":false,"context_lines":[{"line_number":182,"context_line":"            return True"},{"line_number":183,"context_line":"        if node_obj.power_state in bad_power_states:"},{"line_number":184,"context_line":"            return True"},{"line_number":185,"context_line":"        if node_obj.provision_state not in good_provision_states:"},{"line_number":186,"context_line":"            return True"},{"line_number":187,"context_line":"        if node_obj.instance_uuid is not None:"},{"line_number":188,"context_line":"            return True"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"        # NOTE(zhenguo): Node\u0027s resources should not be exposed to Nova"},{"line_number":191,"context_line":"        # if there\u0027s no port associated with it."}],"source_content_type":"text/x-python","patch_set":10,"id":"bacf61ea_9cdceae5","line":188,"range":{"start_line":185,"start_character":0,"end_line":188,"end_character":23},"updated":"2016-07-28 18:35:52.000000000","message":"Here is changed from the previous logic, is it fine?","commit_id":"53da4af6d64f4fc01348cdc4ece34e4f2adbd1fe"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"17719c96c749fe866f4259ba6d50ee89c66ff532","unresolved":false,"context_lines":[{"line_number":182,"context_line":"            return True"},{"line_number":183,"context_line":"        if node_obj.power_state in bad_power_states:"},{"line_number":184,"context_line":"            return True"},{"line_number":185,"context_line":"        if node_obj.provision_state not in good_provision_states:"},{"line_number":186,"context_line":"            return True"},{"line_number":187,"context_line":"        if node_obj.instance_uuid is not None:"},{"line_number":188,"context_line":"            return True"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"        # NOTE(zhenguo): Node\u0027s resources should not be exposed to Nova"},{"line_number":191,"context_line":"        # if there\u0027s no port associated with it."}],"source_content_type":"text/x-python","patch_set":10,"id":"bacf61ea_b7c74011","line":188,"range":{"start_line":185,"start_character":0,"end_line":188,"end_character":23},"in_reply_to":"bacf61ea_05dede3e","updated":"2016-07-28 21:33:46.000000000","message":"Ah, I missed it. Thanks Ruby.","commit_id":"53da4af6d64f4fc01348cdc4ece34e4f2adbd1fe"},{"author":{"_account_id":8125,"name":"Michael Davies","email":"michael@the-davies.net","username":"mrda"},"change_message_id":"44eb1120a85baca6aa591866b95a71139f946149","unresolved":false,"context_lines":[{"line_number":182,"context_line":"            return True"},{"line_number":183,"context_line":"        if node_obj.power_state in bad_power_states:"},{"line_number":184,"context_line":"            return True"},{"line_number":185,"context_line":"        if node_obj.provision_state not in good_provision_states:"},{"line_number":186,"context_line":"            return True"},{"line_number":187,"context_line":"        if node_obj.instance_uuid is not None:"},{"line_number":188,"context_line":"            return True"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"        # NOTE(zhenguo): Node\u0027s resources should not be exposed to Nova"},{"line_number":191,"context_line":"        # if there\u0027s no port associated with it."}],"source_content_type":"text/x-python","patch_set":10,"id":"5a74a57a_40af2d7d","line":188,"range":{"start_line":185,"start_character":0,"end_line":188,"end_character":23},"in_reply_to":"bacf61ea_64b8d111","updated":"2016-11-30 05:30:43.000000000","message":"This is much more maintainable now, thanks for cleaning it up!","commit_id":"53da4af6d64f4fc01348cdc4ece34e4f2adbd1fe"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"2c209bcc2f972cc43716e618a07be46128a403df","unresolved":false,"context_lines":[{"line_number":182,"context_line":"            return True"},{"line_number":183,"context_line":"        if node_obj.power_state in bad_power_states:"},{"line_number":184,"context_line":"            return True"},{"line_number":185,"context_line":"        if node_obj.provision_state not in good_provision_states:"},{"line_number":186,"context_line":"            return True"},{"line_number":187,"context_line":"        if node_obj.instance_uuid is not None:"},{"line_number":188,"context_line":"            return True"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"        # NOTE(zhenguo): Node\u0027s resources should not be exposed to Nova"},{"line_number":191,"context_line":"        # if there\u0027s no port associated with it."}],"source_content_type":"text/x-python","patch_set":10,"id":"bacf61ea_05dede3e","line":188,"range":{"start_line":185,"start_character":0,"end_line":188,"end_character":23},"in_reply_to":"bacf61ea_9cdceae5","updated":"2016-07-28 19:14:37.000000000","message":"Yes it is fine. It isn\u0027t quite changed. The original code had \u0027node._obj.provision_state in good_provision_states and node_obj.instance_uuid is not None\u0027. If we get past line 186 above, we know that \u0027node_obj.provision_state in good_provision_states\u0027 is True.","commit_id":"53da4af6d64f4fc01348cdc4ece34e4f2adbd1fe"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"e7e5f85d30b637d05d4061b9ab067463e5d2592d","unresolved":false,"context_lines":[{"line_number":182,"context_line":"            return True"},{"line_number":183,"context_line":"        if node_obj.power_state in bad_power_states:"},{"line_number":184,"context_line":"            return True"},{"line_number":185,"context_line":"        if node_obj.provision_state not in good_provision_states:"},{"line_number":186,"context_line":"            return True"},{"line_number":187,"context_line":"        if node_obj.instance_uuid is not None:"},{"line_number":188,"context_line":"            return True"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"        # NOTE(zhenguo): Node\u0027s resources should not be exposed to Nova"},{"line_number":191,"context_line":"        # if there\u0027s no port associated with it."}],"source_content_type":"text/x-python","patch_set":10,"id":"bacf61ea_64b8d111","line":188,"range":{"start_line":185,"start_character":0,"end_line":188,"end_character":23},"in_reply_to":"bacf61ea_b7c74011","updated":"2016-08-02 11:13:55.000000000","message":"Thanks Ruby for the explaination!","commit_id":"53da4af6d64f4fc01348cdc4ece34e4f2adbd1fe"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"6f3b8fdf76d9d47adad6eb569244a59456218b35","unresolved":false,"context_lines":[{"line_number":189,"context_line":""},{"line_number":190,"context_line":"        # NOTE(zhenguo): Node\u0027s resources should not be exposed to Nova"},{"line_number":191,"context_line":"        # if there\u0027s no port associated with it."},{"line_number":192,"context_line":"        ports \u003d self.ironicclient.call(\"node.list_ports\", node_obj.uuid)"},{"line_number":193,"context_line":"        if not ports:"},{"line_number":194,"context_line":"            return True"},{"line_number":195,"context_line":"        return False"}],"source_content_type":"text/x-python","patch_set":10,"id":"bacf61ea_24b99ded","line":192,"updated":"2016-08-02 18:23:19.000000000","message":"I worry a bit about the costs of this call. _node_resources_unavailable() is called in a tight loop by the virt driver when the resource tracker\u0027s update_available_resource() for each baremetal resource node in Ironic. So, this will cause N number of HTTP calls to Ironic, one for each baremetal resource node that isn\u0027t already assigned to an instance, right? Is that something we think is acceptable?","commit_id":"53da4af6d64f4fc01348cdc4ece34e4f2adbd1fe"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"5d8142fac406320f015525a201c4f1a5a50c704e","unresolved":false,"context_lines":[{"line_number":189,"context_line":""},{"line_number":190,"context_line":"        # NOTE(zhenguo): Node\u0027s resources should not be exposed to Nova"},{"line_number":191,"context_line":"        # if there\u0027s no port associated with it."},{"line_number":192,"context_line":"        ports \u003d self.ironicclient.call(\"node.list_ports\", node_obj.uuid)"},{"line_number":193,"context_line":"        if not ports:"},{"line_number":194,"context_line":"            return True"},{"line_number":195,"context_line":"        return False"}],"source_content_type":"text/x-python","patch_set":10,"id":"bacf61ea_7747c51d","line":192,"in_reply_to":"bacf61ea_24b99ded","updated":"2016-08-02 18:44:42.000000000","message":"++ I agree that\u0027s unacceptable. We used to do N calls to ironic, one for each node, and it performed terribly. Let\u0027s not regress to that.\n\nWe could do a similar thing we do with nodes, which is to cache one detailed node-list and use it for this loop. I don\u0027t love it but it\u0027d be far better than this.","commit_id":"53da4af6d64f4fc01348cdc4ece34e4f2adbd1fe"},{"author":{"_account_id":6610,"name":"Zhenguo Niu","email":"Niu.ZGlinux@gmail.com","username":"niu-zglinux"},"change_message_id":"16c4c7d224cd769a9ad1d4b72aeeb4e872d75b75","unresolved":false,"context_lines":[{"line_number":189,"context_line":""},{"line_number":190,"context_line":"        # NOTE(zhenguo): Node\u0027s resources should not be exposed to Nova"},{"line_number":191,"context_line":"        # if there\u0027s no port associated with it."},{"line_number":192,"context_line":"        ports \u003d self.ironicclient.call(\"node.list_ports\", node_obj.uuid)"},{"line_number":193,"context_line":"        if not ports:"},{"line_number":194,"context_line":"            return True"},{"line_number":195,"context_line":"        return False"}],"source_content_type":"text/x-python","patch_set":10,"id":"bacf61ea_9c7367b4","line":192,"in_reply_to":"bacf61ea_7747c51d","updated":"2016-08-03 08:11:41.000000000","message":"thanks all for the review, @Jim does it make sense to return node details with ports association information(True or False)? then we don\u0027t have to do extra api calling, and seems it will not only benefit for this, we have many other places which may need to check whether nodes have ports associated.","commit_id":"53da4af6d64f4fc01348cdc4ece34e4f2adbd1fe"},{"author":{"_account_id":8125,"name":"Michael Davies","email":"michael@the-davies.net","username":"mrda"},"change_message_id":"44eb1120a85baca6aa591866b95a71139f946149","unresolved":false,"context_lines":[{"line_number":189,"context_line":""},{"line_number":190,"context_line":"        # NOTE(zhenguo): Node\u0027s resources should not be exposed to Nova"},{"line_number":191,"context_line":"        # if there\u0027s no port associated with it."},{"line_number":192,"context_line":"        ports \u003d self.ironicclient.call(\"node.list_ports\", node_obj.uuid)"},{"line_number":193,"context_line":"        if not ports:"},{"line_number":194,"context_line":"            return True"},{"line_number":195,"context_line":"        return False"}],"source_content_type":"text/x-python","patch_set":10,"id":"5a74a57a_a03ba137","line":192,"in_reply_to":"bacf61ea_9c7367b4","updated":"2016-11-30 05:30:43.000000000","message":"I\u0027m not sure what we could do but give an indication of this in the node_obj","commit_id":"53da4af6d64f4fc01348cdc4ece34e4f2adbd1fe"}]}
