)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"86140b1752d0c66e6afdc4c08f8faa2bf31dbb5d","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"However, other deployments need root device hints, and with fast"},{"line_number":14,"context_line":"track mode in ramdisks, we created a situation where the node cache"},{"line_number":15,"context_line":"could be updated by a human or software betwene the time the agent"},{"line_number":16,"context_line":"was started, and the deployment was requested."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"As a result, the agent has been updated to check if we have a hint"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9f560f44_110ab3d0","line":15,"updated":"2020-08-23 14:12:53.000000000","message":"nit: between","commit_id":"91b13359ad91b3930ba4e4da6423b2f0e462759d"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"579a0849571e553c2704e9c28686e3f9964109f5","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"However, other deployments need root device hints, and with fast"},{"line_number":14,"context_line":"track mode in ramdisks, we created a situation where the node cache"},{"line_number":15,"context_line":"could be updated by a human or software betwene the time the agent"},{"line_number":16,"context_line":"was started, and the deployment was requested."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"As a result, the agent has been updated to check if we have a hint"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9f560f44_14b29749","line":15,"in_reply_to":"9f560f44_110ab3d0","updated":"2020-08-24 14:41:16.000000000","message":"Done","commit_id":"91b13359ad91b3930ba4e4da6423b2f0e462759d"}],"ironic_python_agent/hardware.py":[{"author":{"_account_id":11076,"name":"Shivanand Tendulker","email":"stendulker@gmail.com","username":"stendulker"},"change_message_id":"b8eb391923d5732fead0f70ede5fe6457b85b5cb","unresolved":false,"context_lines":[{"line_number":478,"context_line":""},{"line_number":479,"context_line":"    if client and timeout and interval and not API_CLIENT:"},{"line_number":480,"context_line":"        API_CLIENT \u003d client"},{"line_number":481,"context_line":"        API_LOOKUP_TIMEOUT \u003d timeout \u003d timeout"},{"line_number":482,"context_line":"        API_LOOKUP_INTERVAL \u003d interval"},{"line_number":483,"context_line":""},{"line_number":484,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_edae717f","line":481,"range":{"start_line":481,"start_character":37,"end_line":481,"end_character":46},"updated":"2020-08-20 10:57:22.000000000","message":"s/\u003d timeout //","commit_id":"f0b75e77ca6185d0f7bda657269e4c2a043df9b6"},{"author":{"_account_id":11076,"name":"Shivanand Tendulker","email":"stendulker@gmail.com","username":"stendulker"},"change_message_id":"b8eb391923d5732fead0f70ede5fe6457b85b5cb","unresolved":false,"context_lines":[{"line_number":1090,"context_line":"                or cached_node[\u0027properties\u0027].get(\u0027root_device\u0027))"},{"line_number":1091,"context_line":"            if not root_device_hints:"},{"line_number":1092,"context_line":"                cached_node \u003d update_cached_node()"},{"line_number":1093,"context_line":"                print(cached_node[\u0027instance_info\u0027].get(\u0027root_device\u0027))"},{"line_number":1094,"context_line":"                print(cached_node[\u0027properties\u0027].get(\u0027root_device\u0027))"},{"line_number":1095,"context_line":"                root_device_hints \u003d ("},{"line_number":1096,"context_line":"                    cached_node[\u0027instance_info\u0027].get(\u0027root_device\u0027)"},{"line_number":1097,"context_line":"                    or cached_node[\u0027properties\u0027].get(\u0027root_device\u0027))"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f560f44_ede311d7","line":1094,"range":{"start_line":1093,"start_character":16,"end_line":1094,"end_character":67},"updated":"2020-08-20 10:57:22.000000000","message":"Can be removed.","commit_id":"f0b75e77ca6185d0f7bda657269e4c2a043df9b6"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"86140b1752d0c66e6afdc4c08f8faa2bf31dbb5d","unresolved":false,"context_lines":[{"line_number":485,"context_line":"def update_cached_node():"},{"line_number":486,"context_line":"    \"\"\"Attmepts to update the node cache via the API\"\"\""},{"line_number":487,"context_line":"    cached_node \u003d get_cached_node()"},{"line_number":488,"context_line":"    if API_CLIENT and cached_node:"},{"line_number":489,"context_line":"        try:"},{"line_number":490,"context_line":"            content \u003d API_CLIENT.lookup_node("},{"line_number":491,"context_line":"                hardware_info\u003dlist_hardware_info(use_cache\u003dTrue),"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_710b2fd4","line":488,"updated":"2020-08-23 14:12:53.000000000","message":"nit: I\u0027d remove the chech on \u0027cached_node\u0027, it makes even more sense to update if there is no cached node","commit_id":"91b13359ad91b3930ba4e4da6423b2f0e462759d"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"579a0849571e553c2704e9c28686e3f9964109f5","unresolved":false,"context_lines":[{"line_number":485,"context_line":"def update_cached_node():"},{"line_number":486,"context_line":"    \"\"\"Attmepts to update the node cache via the API\"\"\""},{"line_number":487,"context_line":"    cached_node \u003d get_cached_node()"},{"line_number":488,"context_line":"    if API_CLIENT and cached_node:"},{"line_number":489,"context_line":"        try:"},{"line_number":490,"context_line":"            content \u003d API_CLIENT.lookup_node("},{"line_number":491,"context_line":"                hardware_info\u003dlist_hardware_info(use_cache\u003dTrue),"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_619a3714","line":488,"in_reply_to":"9f560f44_710b2fd4","updated":"2020-08-24 14:41:16.000000000","message":"Done","commit_id":"91b13359ad91b3930ba4e4da6423b2f0e462759d"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"86140b1752d0c66e6afdc4c08f8faa2bf31dbb5d","unresolved":false,"context_lines":[{"line_number":486,"context_line":"    \"\"\"Attmepts to update the node cache via the API\"\"\""},{"line_number":487,"context_line":"    cached_node \u003d get_cached_node()"},{"line_number":488,"context_line":"    if API_CLIENT and cached_node:"},{"line_number":489,"context_line":"        try:"},{"line_number":490,"context_line":"            content \u003d API_CLIENT.lookup_node("},{"line_number":491,"context_line":"                hardware_info\u003dlist_hardware_info(use_cache\u003dTrue),"},{"line_number":492,"context_line":"                timeout\u003dAPI_LOOKUP_TIMEOUT,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_5110ab00","line":489,"updated":"2020-08-23 14:12:53.000000000","message":"nit: maybe a LOG.info before doing this? so that it\u0027s clear from the logs why another lookup happens?","commit_id":"91b13359ad91b3930ba4e4da6423b2f0e462759d"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"579a0849571e553c2704e9c28686e3f9964109f5","unresolved":false,"context_lines":[{"line_number":486,"context_line":"    \"\"\"Attmepts to update the node cache via the API\"\"\""},{"line_number":487,"context_line":"    cached_node \u003d get_cached_node()"},{"line_number":488,"context_line":"    if API_CLIENT and cached_node:"},{"line_number":489,"context_line":"        try:"},{"line_number":490,"context_line":"            content \u003d API_CLIENT.lookup_node("},{"line_number":491,"context_line":"                hardware_info\u003dlist_hardware_info(use_cache\u003dTrue),"},{"line_number":492,"context_line":"                timeout\u003dAPI_LOOKUP_TIMEOUT,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_418f33cc","line":489,"in_reply_to":"9f560f44_5110ab00","updated":"2020-08-24 14:41:16.000000000","message":"Done","commit_id":"91b13359ad91b3930ba4e4da6423b2f0e462759d"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"86140b1752d0c66e6afdc4c08f8faa2bf31dbb5d","unresolved":false,"context_lines":[{"line_number":487,"context_line":"    cached_node \u003d get_cached_node()"},{"line_number":488,"context_line":"    if API_CLIENT and cached_node:"},{"line_number":489,"context_line":"        try:"},{"line_number":490,"context_line":"            content \u003d API_CLIENT.lookup_node("},{"line_number":491,"context_line":"                hardware_info\u003dlist_hardware_info(use_cache\u003dTrue),"},{"line_number":492,"context_line":"                timeout\u003dAPI_LOOKUP_TIMEOUT,"},{"line_number":493,"context_line":"                starting_interval\u003dAPI_LOOKUP_INTERVAL,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_b1f827c4","line":490,"updated":"2020-08-23 14:12:53.000000000","message":"nit: This will cause a warning about duplicate token generation in ironic, which we should maybe supress..","commit_id":"91b13359ad91b3930ba4e4da6423b2f0e462759d"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"bcba5711c9a01aa969c37d6b751d5797c19b700e","unresolved":false,"context_lines":[{"line_number":487,"context_line":"    cached_node \u003d get_cached_node()"},{"line_number":488,"context_line":"    if API_CLIENT and cached_node:"},{"line_number":489,"context_line":"        try:"},{"line_number":490,"context_line":"            content \u003d API_CLIENT.lookup_node("},{"line_number":491,"context_line":"                hardware_info\u003dlist_hardware_info(use_cache\u003dTrue),"},{"line_number":492,"context_line":"                timeout\u003dAPI_LOOKUP_TIMEOUT,"},{"line_number":493,"context_line":"                starting_interval\u003dAPI_LOOKUP_INTERVAL,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_d49f7f4d","line":490,"in_reply_to":"9f560f44_218cbfd5","updated":"2020-08-24 14:55:20.000000000","message":"On the ironic-conductor side we raise a warning if the token is present, even if it\u0027s pre-generated. This lookup will also cause this warning. Not sure if anything can be done about it..","commit_id":"91b13359ad91b3930ba4e4da6423b2f0e462759d"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"579a0849571e553c2704e9c28686e3f9964109f5","unresolved":false,"context_lines":[{"line_number":487,"context_line":"    cached_node \u003d get_cached_node()"},{"line_number":488,"context_line":"    if API_CLIENT and cached_node:"},{"line_number":489,"context_line":"        try:"},{"line_number":490,"context_line":"            content \u003d API_CLIENT.lookup_node("},{"line_number":491,"context_line":"                hardware_info\u003dlist_hardware_info(use_cache\u003dTrue),"},{"line_number":492,"context_line":"                timeout\u003dAPI_LOOKUP_TIMEOUT,"},{"line_number":493,"context_line":"                starting_interval\u003dAPI_LOOKUP_INTERVAL,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_218cbfd5","line":490,"in_reply_to":"9f560f44_b1f827c4","updated":"2020-08-24 14:41:16.000000000","message":"I think your thinking of the code path in agent. The api client lookup_node is really minimal...","commit_id":"91b13359ad91b3930ba4e4da6423b2f0e462759d"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"0963cc631df66f61c2cdb3baeb50236e291e34a0","unresolved":false,"context_lines":[{"line_number":487,"context_line":"    cached_node \u003d get_cached_node()"},{"line_number":488,"context_line":"    if API_CLIENT and cached_node:"},{"line_number":489,"context_line":"        try:"},{"line_number":490,"context_line":"            content \u003d API_CLIENT.lookup_node("},{"line_number":491,"context_line":"                hardware_info\u003dlist_hardware_info(use_cache\u003dTrue),"},{"line_number":492,"context_line":"                timeout\u003dAPI_LOOKUP_TIMEOUT,"},{"line_number":493,"context_line":"                starting_interval\u003dAPI_LOOKUP_INTERVAL,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_070d34e7","line":490,"in_reply_to":"9f560f44_d49f7f4d","updated":"2020-09-02 16:43:06.000000000","message":"OH! hmm.. yeah. :\\","commit_id":"91b13359ad91b3930ba4e4da6423b2f0e462759d"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"86140b1752d0c66e6afdc4c08f8faa2bf31dbb5d","unresolved":false,"context_lines":[{"line_number":491,"context_line":"                hardware_info\u003dlist_hardware_info(use_cache\u003dTrue),"},{"line_number":492,"context_line":"                timeout\u003dAPI_LOOKUP_TIMEOUT,"},{"line_number":493,"context_line":"                starting_interval\u003dAPI_LOOKUP_INTERVAL,"},{"line_number":494,"context_line":"                uuid\u003dcached_node[\u0027uuid\u0027])"},{"line_number":495,"context_line":"            cache_node(content[\u0027node\u0027])"},{"line_number":496,"context_line":"            return content[\u0027node\u0027]"},{"line_number":497,"context_line":"        except Exception as exc:"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_91f523ce","line":494,"updated":"2020-08-23 14:12:53.000000000","message":"nit: if you allow cached_node to be None, this should be updated","commit_id":"91b13359ad91b3930ba4e4da6423b2f0e462759d"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"579a0849571e553c2704e9c28686e3f9964109f5","unresolved":false,"context_lines":[{"line_number":491,"context_line":"                hardware_info\u003dlist_hardware_info(use_cache\u003dTrue),"},{"line_number":492,"context_line":"                timeout\u003dAPI_LOOKUP_TIMEOUT,"},{"line_number":493,"context_line":"                starting_interval\u003dAPI_LOOKUP_INTERVAL,"},{"line_number":494,"context_line":"                uuid\u003dcached_node[\u0027uuid\u0027])"},{"line_number":495,"context_line":"            cache_node(content[\u0027node\u0027])"},{"line_number":496,"context_line":"            return content[\u0027node\u0027]"},{"line_number":497,"context_line":"        except Exception as exc:"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_e1ae472c","line":494,"in_reply_to":"9f560f44_91f523ce","updated":"2020-08-24 14:41:16.000000000","message":"Done","commit_id":"91b13359ad91b3930ba4e4da6423b2f0e462759d"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"86140b1752d0c66e6afdc4c08f8faa2bf31dbb5d","unresolved":false,"context_lines":[{"line_number":495,"context_line":"            cache_node(content[\u0027node\u0027])"},{"line_number":496,"context_line":"            return content[\u0027node\u0027]"},{"line_number":497,"context_line":"        except Exception as exc:"},{"line_number":498,"context_line":"            LOG.warning(\u0027Failed to update node cache. Error %s\u0027, exc)"},{"line_number":499,"context_line":"    return cached_node"},{"line_number":500,"context_line":""},{"line_number":501,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_f1fe1fad","line":498,"updated":"2020-08-23 14:12:53.000000000","message":"nit: lookup already logs errors","commit_id":"91b13359ad91b3930ba4e4da6423b2f0e462759d"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"579a0849571e553c2704e9c28686e3f9964109f5","unresolved":false,"context_lines":[{"line_number":495,"context_line":"            cache_node(content[\u0027node\u0027])"},{"line_number":496,"context_line":"            return content[\u0027node\u0027]"},{"line_number":497,"context_line":"        except Exception as exc:"},{"line_number":498,"context_line":"            LOG.warning(\u0027Failed to update node cache. Error %s\u0027, exc)"},{"line_number":499,"context_line":"    return cached_node"},{"line_number":500,"context_line":""},{"line_number":501,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_e1000737","line":498,"in_reply_to":"9f560f44_f1fe1fad","updated":"2020-08-24 14:41:16.000000000","message":"lookup_node only does on LoopingCallTimeout, otherwise it raises it up.","commit_id":"91b13359ad91b3930ba4e4da6423b2f0e462759d"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"86140b1752d0c66e6afdc4c08f8faa2bf31dbb5d","unresolved":false,"context_lines":[{"line_number":716,"context_line":"        max_waits \u003d CONF.disk_wait_attempts - 1"},{"line_number":717,"context_line":"        for attempt in range(CONF.disk_wait_attempts):"},{"line_number":718,"context_line":"            try:"},{"line_number":719,"context_line":"                self.get_os_install_device()"},{"line_number":720,"context_line":"            except errors.DeviceNotFound:"},{"line_number":721,"context_line":"                LOG.debug(\u0027Still waiting for the root device to appear, \u0027"},{"line_number":722,"context_line":"                          \u0027attempt %d of %d\u0027, attempt + 1,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_d1fb1bbb","line":719,"updated":"2020-08-23 14:12:53.000000000","message":"As I comment below, this is where get_os_install_device is called several times. Maybe avoid re-caching the node each time?","commit_id":"91b13359ad91b3930ba4e4da6423b2f0e462759d"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"86140b1752d0c66e6afdc4c08f8faa2bf31dbb5d","unresolved":false,"context_lines":[{"line_number":1088,"context_line":"            root_device_hints \u003d ("},{"line_number":1089,"context_line":"                cached_node[\u0027instance_info\u0027].get(\u0027root_device\u0027)"},{"line_number":1090,"context_line":"                or cached_node[\u0027properties\u0027].get(\u0027root_device\u0027))"},{"line_number":1091,"context_line":"            if not root_device_hints:"},{"line_number":1092,"context_line":"                cached_node \u003d update_cached_node()"},{"line_number":1093,"context_line":"                root_device_hints \u003d ("},{"line_number":1094,"context_line":"                    cached_node[\u0027instance_info\u0027].get(\u0027root_device\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9f560f44_312ed742","line":1091,"updated":"2020-08-23 14:12:53.000000000","message":"As I note above, get_os_install_device is called in a loop on start-up, maybe skip this logic in the case?","commit_id":"91b13359ad91b3930ba4e4da6423b2f0e462759d"}],"ironic_python_agent/tests/unit/test_hardware.py":[{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"6089048e88d17ac272d5a3584bb79080381bf19f","unresolved":false,"context_lines":[{"line_number":4537,"context_line":"        calls \u003d [mock.call(\u0027list_hardware_info\u0027),"},{"line_number":4538,"context_line":"                 mock.call(\u0027wait_for_disks\u0027)]"},{"line_number":4539,"context_line":"        mock_dispatch.assert_has_calls(calls)"},{"line_number":4540,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9f560f44_e4068386","line":4540,"updated":"2020-08-20 19:30:45.000000000","message":"pep8: W391 blank line at end of file","commit_id":"1493629f20315a12aed9725df520e031956a5d76"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"49394734361e6911b343376f66572250819111ef","unresolved":false,"context_lines":[{"line_number":4536,"context_line":"        self.assertEqual(updated_node, hardware.NODE)"},{"line_number":4537,"context_line":"        calls \u003d [mock.call(\u0027list_hardware_info\u0027),"},{"line_number":4538,"context_line":"                 mock.call(\u0027wait_for_disks\u0027)]"},{"line_number":4539,"context_line":"        mock_dispatch.assert_has_calls(calls)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9f560f44_fce9f319","line":4539,"updated":"2020-08-21 00:33:46.000000000","message":"pep8: W292 no newline at end of file","commit_id":"1f87557301d7db1ceeae7bee22a8d550c5c9aaa8"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"a7e6fb63d0d5aab55b21a75eac877af0d3dcafe6","unresolved":false,"context_lines":[{"line_number":1502,"context_line":"                                    \u0027uuid\u0027: \u0027node1\u0027,"},{"line_number":1503,"context_line":"                                    \u0027instance_info\u0027: {\u0027magic\u0027: \u0027value\u0027}}"},{"line_number":1504,"context_line":"        self.assertEqual(\u0027/dev/sda\u0027,"},{"line_number":1505,"context_line":"                         self.hardware.get_os_install_device(permit_refresh\u003dTrue))"},{"line_number":1506,"context_line":"        self.assertEqual(1, mock_cached_node.call_count)"},{"line_number":1507,"context_line":"        mock_dev.assert_called_once_with()"},{"line_number":1508,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"9f560f44_4dd80252","line":1505,"updated":"2020-08-24 17:10:28.000000000","message":"pep8: E501 line too long (82 \u003e 79 characters)","commit_id":"6ba7601df42120cc8d390fe5d4bc0bdc6c01a4f9"}]}
