)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":33543,"name":"liuhuajie","email":"liu.huajie@99cloud.net","username":"liuhuajie"},"change_message_id":"b1efd8ff2e0e0bc25dbf96d7460918f5074f87d1","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"535a8bb1_38d685f6","updated":"2022-07-21 04:57:17.000000000","message":"recheck","commit_id":"126e47f386a9a6be2682b0121611f888707461f6"}],"cinder/volume/drivers/sandstone/sds_client.py":[{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"48b9e421ca541ead784e6cb2dcc80749c6786493","unresolved":true,"context_lines":[{"line_number":270,"context_line":"        self._assert_restapi_result(result, _(\"Query mapping \""},{"line_number":271,"context_line":"                                              \"initiator process error.\"))"},{"line_number":272,"context_line":""},{"line_number":273,"context_line":"        result \u003d result[\"data\"].get(\"results\") or []"},{"line_number":274,"context_line":"        expected_parameter \u003d [{\"target_name\": target_name,"},{"line_number":275,"context_line":"                               \"iqns\": [{\"ip\": \"\", \"iqn\": initiator_name}]}]"},{"line_number":276,"context_line":"        task \u003d [map_initiator_task for map_initiator_task in result"}],"source_content_type":"text/x-python","patch_set":2,"id":"668e180e_46b2fa54","line":273,"range":{"start_line":273,"start_character":31,"end_line":273,"end_character":52},"updated":"2022-10-10 15:55:15.000000000","message":"The correct way to do this, if you want to simplify things, would be .get(\"results\", []).","commit_id":"2cd5711f0931ffbdd0b2c3f2a7356d34933f3542"},{"author":{"_account_id":13671,"name":"Vladislav Belogrudov","email":"v.belogrudov@yadro.com","username":"vb"},"change_message_id":"28648edecb009fe3605df85e64da4c3d0ae109f4","unresolved":true,"context_lines":[{"line_number":270,"context_line":"        self._assert_restapi_result(result, _(\"Query mapping \""},{"line_number":271,"context_line":"                                              \"initiator process error.\"))"},{"line_number":272,"context_line":""},{"line_number":273,"context_line":"        result \u003d result[\"data\"].get(\"results\") or []"},{"line_number":274,"context_line":"        expected_parameter \u003d [{\"target_name\": target_name,"},{"line_number":275,"context_line":"                               \"iqns\": [{\"ip\": \"\", \"iqn\": initiator_name}]}]"},{"line_number":276,"context_line":"        task \u003d [map_initiator_task for map_initiator_task in result"}],"source_content_type":"text/x-python","patch_set":2,"id":"43d5a2a7_2170c58f","line":273,"range":{"start_line":273,"start_character":31,"end_line":273,"end_character":52},"in_reply_to":"1433c126_62f6d915","updated":"2022-10-21 12:41:43.000000000","message":"liuhuajie, you are right in your example, if the key is present there even with None value. Can \u0027results\u0027 be always there even with None or can it be just absent? In any case the suggestion looks completely OK for me.","commit_id":"2cd5711f0931ffbdd0b2c3f2a7356d34933f3542"},{"author":{"_account_id":33543,"name":"liuhuajie","email":"liu.huajie@99cloud.net","username":"liuhuajie"},"change_message_id":"f2ffe08773bd67e130fa945594e7ba2303dcde0d","unresolved":true,"context_lines":[{"line_number":270,"context_line":"        self._assert_restapi_result(result, _(\"Query mapping \""},{"line_number":271,"context_line":"                                              \"initiator process error.\"))"},{"line_number":272,"context_line":""},{"line_number":273,"context_line":"        result \u003d result[\"data\"].get(\"results\") or []"},{"line_number":274,"context_line":"        expected_parameter \u003d [{\"target_name\": target_name,"},{"line_number":275,"context_line":"                               \"iqns\": [{\"ip\": \"\", \"iqn\": initiator_name}]}]"},{"line_number":276,"context_line":"        task \u003d [map_initiator_task for map_initiator_task in result"}],"source_content_type":"text/x-python","patch_set":2,"id":"1433c126_62f6d915","line":273,"range":{"start_line":273,"start_character":31,"end_line":273,"end_character":52},"in_reply_to":"668e180e_46b2fa54","updated":"2022-10-21 07:28:01.000000000","message":"I think you are wrong. \nThe result type should be list.\n\nThe two methods give different results, you can try the following:\n\ntest \u003d {\"results\": None}\nresult1 \u003d test.get(\"results\") or []\nresult2 \u003d test.get(\"results\", [])","commit_id":"2cd5711f0931ffbdd0b2c3f2a7356d34933f3542"}]}
