)]}'
{"blazar/tests/utils/openstack/test_placement.py":[{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@linecorp.com","username":"masa"},"change_message_id":"f4b3adf9c37d75c817294a243f8c61ccd8541b8f","unresolved":false,"context_lines":[{"line_number":560,"context_line":"        self.assertRaises("},{"line_number":561,"context_line":"            exceptions.InventoryConflict,"},{"line_number":562,"context_line":"            self.client.update_reservation_inventory, host_name, \u0027add\u0027, 3)"},{"line_number":563,"context_line":"        print(kss_req.call_count)"},{"line_number":564,"context_line":"        self.assertEqual(5, kss_req.call_count)"},{"line_number":565,"context_line":"        kss_req.reset_mock()"},{"line_number":566,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_1d7a4476","line":563,"range":{"start_line":563,"start_character":8,"end_line":563,"end_character":33},"updated":"2019-02-26 07:22:19.000000000","message":"For debugging?","commit_id":"a6e2affa02d400a521f3c07b867a6a72e55e0a53"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"2c767b2589caa76c5af416c50dc6cff1c9ce8601","unresolved":false,"context_lines":[{"line_number":560,"context_line":"        self.assertRaises("},{"line_number":561,"context_line":"            exceptions.InventoryConflict,"},{"line_number":562,"context_line":"            self.client.update_reservation_inventory, host_name, \u0027add\u0027, 3)"},{"line_number":563,"context_line":"        print(kss_req.call_count)"},{"line_number":564,"context_line":"        self.assertEqual(5, kss_req.call_count)"},{"line_number":565,"context_line":"        kss_req.reset_mock()"},{"line_number":566,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_0cc2a687","line":563,"range":{"start_line":563,"start_character":8,"end_line":563,"end_character":33},"in_reply_to":"9fdfeff1_1d7a4476","updated":"2019-03-03 05:19:29.000000000","message":"oops","commit_id":"a6e2affa02d400a521f3c07b867a6a72e55e0a53"}],"blazar/utils/openstack/placement.py":[{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@linecorp.com","username":"masa"},"change_message_id":"f4b3adf9c37d75c817294a243f8c61ccd8541b8f","unresolved":false,"context_lines":[{"line_number":308,"context_line":"        if resp:"},{"line_number":309,"context_line":"            return resp.json()"},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"        if resp.status_code \u003d\u003d 409:"},{"line_number":312,"context_line":"            # NOTE(tetsuro): Another thread updated the inventory of the same"},{"line_number":313,"context_line":"            # rp during the get_inventory() and the put(). We simply retry it"},{"line_number":314,"context_line":"            # for this case."},{"line_number":315,"context_line":"            msg \u003d (\"Conflict on updating inventory in placement. \""},{"line_number":316,"context_line":"                   \"Got %(status_code)d: %(err_text)s. \")"},{"line_number":317,"context_line":"            args \u003d {"},{"line_number":318,"context_line":"                \u0027status_code\u0027: resp.status_code,"},{"line_number":319,"context_line":"                \u0027err_text\u0027: resp.text,"},{"line_number":320,"context_line":"            }"},{"line_number":321,"context_line":"            LOG.error(msg, args)"},{"line_number":322,"context_line":"            raise exceptions.InventoryConflict(resource_provider\u003drp_uuid)"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"        raise exceptions.InventoryUpdateFailed(resource_provider\u003drp_uuid)"},{"line_number":325,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_1da1e4f7","line":322,"range":{"start_line":311,"start_character":0,"end_line":322,"end_character":73},"updated":"2019-02-26 07:22:19.000000000","message":"Should the if-block be placed above the previous if-block?  If resp has the status_code attribute \u0027if resp:\u0027 becomes True.","commit_id":"a6e2affa02d400a521f3c07b867a6a72e55e0a53"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"2c767b2589caa76c5af416c50dc6cff1c9ce8601","unresolved":false,"context_lines":[{"line_number":308,"context_line":"        if resp:"},{"line_number":309,"context_line":"            return resp.json()"},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"        if resp.status_code \u003d\u003d 409:"},{"line_number":312,"context_line":"            # NOTE(tetsuro): Another thread updated the inventory of the same"},{"line_number":313,"context_line":"            # rp during the get_inventory() and the put(). We simply retry it"},{"line_number":314,"context_line":"            # for this case."},{"line_number":315,"context_line":"            msg \u003d (\"Conflict on updating inventory in placement. \""},{"line_number":316,"context_line":"                   \"Got %(status_code)d: %(err_text)s. \")"},{"line_number":317,"context_line":"            args \u003d {"},{"line_number":318,"context_line":"                \u0027status_code\u0027: resp.status_code,"},{"line_number":319,"context_line":"                \u0027err_text\u0027: resp.text,"},{"line_number":320,"context_line":"            }"},{"line_number":321,"context_line":"            LOG.error(msg, args)"},{"line_number":322,"context_line":"            raise exceptions.InventoryConflict(resource_provider\u003drp_uuid)"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"        raise exceptions.InventoryUpdateFailed(resource_provider\u003drp_uuid)"},{"line_number":325,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_ecb88212","line":322,"range":{"start_line":311,"start_character":0,"end_line":322,"end_character":73},"in_reply_to":"9fdfeff1_1da1e4f7","updated":"2019-03-03 05:19:29.000000000","message":"No, this is a requests.Response object and returns True only if the status_code is less than 400.\n[1] http://docs.python-requests.org/en/master/_modules/requests/models/#Response","commit_id":"a6e2affa02d400a521f3c07b867a6a72e55e0a53"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@linecorp.com","username":"masa"},"change_message_id":"5efc65496d3d43899cbb6e534410856261935e6d","unresolved":false,"context_lines":[{"line_number":308,"context_line":"        if resp:"},{"line_number":309,"context_line":"            return resp.json()"},{"line_number":310,"context_line":""},{"line_number":311,"context_line":"        if resp.status_code \u003d\u003d 409:"},{"line_number":312,"context_line":"            # NOTE(tetsuro): Another thread updated the inventory of the same"},{"line_number":313,"context_line":"            # rp during the get_inventory() and the put(). We simply retry it"},{"line_number":314,"context_line":"            # for this case."},{"line_number":315,"context_line":"            msg \u003d (\"Conflict on updating inventory in placement. \""},{"line_number":316,"context_line":"                   \"Got %(status_code)d: %(err_text)s. \")"},{"line_number":317,"context_line":"            args \u003d {"},{"line_number":318,"context_line":"                \u0027status_code\u0027: resp.status_code,"},{"line_number":319,"context_line":"                \u0027err_text\u0027: resp.text,"},{"line_number":320,"context_line":"            }"},{"line_number":321,"context_line":"            LOG.error(msg, args)"},{"line_number":322,"context_line":"            raise exceptions.InventoryConflict(resource_provider\u003drp_uuid)"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"        raise exceptions.InventoryUpdateFailed(resource_provider\u003drp_uuid)"},{"line_number":325,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5fc1f717_9965dab7","line":322,"range":{"start_line":311,"start_character":0,"end_line":322,"end_character":73},"in_reply_to":"9fdfeff1_ecb88212","updated":"2019-03-26 06:46:38.000000000","message":"I didn\u0027t know that. Thanks :-)","commit_id":"a6e2affa02d400a521f3c07b867a6a72e55e0a53"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"eb5b5c38265c87b83cf9789b48e00c3ad954afd2","unresolved":false,"context_lines":[{"line_number":339,"context_line":"        if resp:"},{"line_number":340,"context_line":"            return resp.json()"},{"line_number":341,"context_line":""},{"line_number":342,"context_line":"        if resp.status_code \u003d\u003d 409:"},{"line_number":343,"context_line":"            # NOTE(tetsuro): Another thread updated the inventory of the same"},{"line_number":344,"context_line":"            # rp during the get_inventory() and the put(). We simply retry it"},{"line_number":345,"context_line":"            # for this case."}],"source_content_type":"text/x-python","patch_set":9,"id":"5fc1f717_1cd27835","line":342,"updated":"2019-04-04 16:33:45.000000000","message":"You may need to check errors[0].code here to compare \u0027placement.inventory.inuse\u0027 and \u0027placement.concurrent_update\u0027. The former can happen when you PUT to the url you\u0027re using and the new inventory will remove or lower a segement of inventory that is in use. Look for InventoryInUse in placement/objects/resource_provider.py to see where.\n\nEven if that\u0027s unlikely to happen in this code path, because there are multiple ways a 409 can happen it is reasonably to check \u0027code\u0027 here and only do this block on the concurrent_update one.","commit_id":"241002430c9254e18055242c08189054c5431097"}]}
