)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":35896,"name":"Bruno Drugowick Muniz","display_name":"Bruno","email":"bruno.muniz@encora.com","username":"brunomuniz"},"change_message_id":"1653116c0b32ff2d1ea18962cc763d159709a577","unresolved":true,"context_lines":[{"line_number":4,"context_line":"Commit:     Tomás Barros \u003ctomas.barros@encora.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2023-05-03 15:32:16 -0300"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"- add new  stage for checking if host is unlocked, enabled and available in post controller-unlock stage for AIO-SX installation"},{"line_number":8,"context_line":"- corrected spelling typos, changed log_output to be shown as default and made little changes in docstring"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"Change-Id: Iccb6ce5bd5c8327047f757019023de18fc6cedc7"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"19dd7fb7_1f2b061d","line":7,"updated":"2023-05-04 11:53:47.000000000","message":"Make sure that the commit message follows the expected format: https://docs.opendev.org/opendev/infra-manual/latest/developers.html#committing-changes","commit_id":"0b5544a41e721b709d419edb875299fc9fd2bfc8"},{"author":{"_account_id":35944,"name":"Tomás Nascimento Pimentel Barros","display_name":"Tomás Barros","email":"tomas.barros@encora.com","username":"tomas_barros_encora"},"change_message_id":"19f806886f1b3a197ae9e6b9fc96796a195c8280","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Tomás Barros \u003ctomas.barros@encora.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2023-05-03 15:32:16 -0300"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"- add new  stage for checking if host is unlocked, enabled and available in post controller-unlock stage for AIO-SX installation"},{"line_number":8,"context_line":"- corrected spelling typos, changed log_output to be shown as default and made little changes in docstring"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"Change-Id: Iccb6ce5bd5c8327047f757019023de18fc6cedc7"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"defbebf0_4dd13deb","line":7,"in_reply_to":"19dd7fb7_1f2b061d","updated":"2023-05-09 16:31:55.000000000","message":"Done","commit_id":"0b5544a41e721b709d419edb875299fc9fd2bfc8"},{"author":{"_account_id":35920,"name":"dcaires","display_name":"Daniel Caires","email":"daniel.caires@encora.com","username":"Daniel.Caires"},"change_message_id":"7bdc7b66068d1c7206fb690ad6b92c87dddf0246","unresolved":true,"context_lines":[{"line_number":10,"context_line":" - unlocked"},{"line_number":11,"context_line":" - enabled"},{"line_number":12,"context_line":" - avaible"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Task: 47892"},{"line_number":15,"context_line":"Story: 2005051"},{"line_number":16,"context_line":"Change-Id: Iccb6ce5bd5c8327047f757019023de18fc6cedc7"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"84063b3f_9b8a0a8f","line":13,"updated":"2023-05-10 13:52:04.000000000","message":"I don\u0027t know if it is absolutely necessary, in any case. Stick to 50 characters per line an add the sign-off. Also just so we don\u0027t have spealling mistakes, it is written \u0027avaible\u0027","commit_id":"9739185cd485c5cc8cc9a5a8471b502d6889d433"},{"author":{"_account_id":35920,"name":"dcaires","display_name":"Daniel Caires","email":"daniel.caires@encora.com","username":"Daniel.Caires"},"change_message_id":"0233019ff4f6d055f80d9e38e7684e09f82849fd","unresolved":false,"context_lines":[{"line_number":10,"context_line":" - unlocked"},{"line_number":11,"context_line":" - enabled"},{"line_number":12,"context_line":" - avaible"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Task: 47892"},{"line_number":15,"context_line":"Story: 2005051"},{"line_number":16,"context_line":"Change-Id: Iccb6ce5bd5c8327047f757019023de18fc6cedc7"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"17bf3635_57eb4865","line":13,"in_reply_to":"84063b3f_9b8a0a8f","updated":"2023-05-10 17:30:40.000000000","message":"Done","commit_id":"9739185cd485c5cc8cc9a5a8471b502d6889d433"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":35896,"name":"Bruno Drugowick Muniz","display_name":"Bruno","email":"bruno.muniz@encora.com","username":"brunomuniz"},"change_message_id":"c75e57f061b268ad8561351c09544c27a18a6cec","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"a836a532_3d5b16a7","updated":"2023-05-10 19:03:12.000000000","message":"I\u0027m ok with the code. I only added comments for you to explain briefly in the comments here what you showed me the other day about the question I had.","commit_id":"696dc56fa0b2bc077681c924eb31608c5ef94646"},{"author":{"_account_id":33390,"name":"Heitor Matsui","display_name":"Heitor Matsui","email":"HeitorVieira.Matsui@windriver.com","username":"heitormatsui"},"change_message_id":"e7a078512525bd3a7300dea51fc0779c46192b71","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"0c3667f9_af64735e","updated":"2023-05-23 13:42:12.000000000","message":"Missing Test Plan","commit_id":"b894b0cba18b1a34c61c7d1dc8e47b427597122c"},{"author":{"_account_id":35967,"name":"Lindley Werner Soares Vieira","display_name":"Lindley Werner","email":"lindley.vieira@encora.com","username":"lindleywerner"},"change_message_id":"940c8405d30e6ca0d40cb978f94c603fc4e3f844","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":19,"id":"e4a9e5a3_7192f690","updated":"2023-06-21 14:22:18.000000000","message":"I will recommend you to cherry-pick this review on top of: https://review.opendev.org/c/starlingx/tools/+/885544\n\nThis way you will have pylint and the tests boilerplate running","commit_id":"f9819fdc47f160e7d00ec6f5288be94c1950a00c"},{"author":{"_account_id":35920,"name":"dcaires","display_name":"Daniel Caires","email":"daniel.caires@encora.com","username":"Daniel.Caires"},"change_message_id":"47104046a48afcf78b8941ea85ea71827427d4e9","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":20,"id":"39354afa_c57b5df7","updated":"2023-06-27 14:58:14.000000000","message":"While reading the whole code I came across a function in install_vbox.py that does something very similar, maybe its the case to take a look into it in order to avoid 2 functions that are too much alike. The function in question is the wait_for_hosts","commit_id":"c7d06e4ffead37639478418fae7171a07e34d92a"}],"deployment/virtualbox/pybox/install_vbox.py":[{"author":{"_account_id":35896,"name":"Bruno Drugowick Muniz","display_name":"Bruno","email":"bruno.muniz@encora.com","username":"brunomuniz"},"change_message_id":"97042c8e1805240219592d7cf16bd5ba546f8c72","unresolved":true,"context_lines":[{"line_number":1207,"context_line":"            code, msg \u003d check_host_status(ssh_client, hostname, status)"},{"line_number":1208,"context_line":"            host_code \u003d max(host_code, code)"},{"line_number":1209,"context_line":"            error_msgs +\u003d msg"},{"line_number":1210,"context_line":"        if host_code \u003d\u003d 1:"},{"line_number":1211,"context_line":"            raise Exception(error_msgs)"},{"line_number":1212,"context_line":""},{"line_number":1213,"context_line":"        LOG.info(\u0027\u003d\u0027 * 121)"}],"source_content_type":"text/x-python","patch_set":1,"id":"d169a655_e95d9ca0","line":1210,"updated":"2023-05-04 13:46:19.000000000","message":"I had to read this and the `check_host_status` functions to understand that `1` means failure and `0` means success; and also to understand that only `0` and `1` are valid values returned in the `code` variable.\n\nThis \"success/failure\" return value is not an error code that comes from Bash or anything, so we can determine by ourselves what to put in it, right?\n\nWouldn\u0027t it be better, then, if it was a Boolean or something?","commit_id":"0b5544a41e721b709d419edb875299fc9fd2bfc8"},{"author":{"_account_id":35944,"name":"Tomás Nascimento Pimentel Barros","display_name":"Tomás Barros","email":"tomas.barros@encora.com","username":"tomas_barros_encora"},"change_message_id":"19f806886f1b3a197ae9e6b9fc96796a195c8280","unresolved":false,"context_lines":[{"line_number":1207,"context_line":"            code, msg \u003d check_host_status(ssh_client, hostname, status)"},{"line_number":1208,"context_line":"            host_code \u003d max(host_code, code)"},{"line_number":1209,"context_line":"            error_msgs +\u003d msg"},{"line_number":1210,"context_line":"        if host_code \u003d\u003d 1:"},{"line_number":1211,"context_line":"            raise Exception(error_msgs)"},{"line_number":1212,"context_line":""},{"line_number":1213,"context_line":"        LOG.info(\u0027\u003d\u0027 * 121)"}],"source_content_type":"text/x-python","patch_set":1,"id":"a17b1ced_035c21ae","line":1210,"in_reply_to":"d169a655_e95d9ca0","updated":"2023-05-09 16:31:55.000000000","message":"Done","commit_id":"0b5544a41e721b709d419edb875299fc9fd2bfc8"},{"author":{"_account_id":35896,"name":"Bruno Drugowick Muniz","display_name":"Bruno","email":"bruno.muniz@encora.com","username":"brunomuniz"},"change_message_id":"97042c8e1805240219592d7cf16bd5ba546f8c72","unresolved":true,"context_lines":[{"line_number":1218,"context_line":"def check_host_status(ssh_client, hostname, status):"},{"line_number":1219,"context_line":"    \u0027\u0027\u0027"},{"line_number":1220,"context_line":"    This function aims to check if some controller is unlocked, enabled and available"},{"line_number":1221,"context_line":"    using the grep linux tool"},{"line_number":1222,"context_line":"    \u0027\u0027\u0027"},{"line_number":1223,"context_line":"    host_statuses, _, _ \u003d run_ssh_cmd("},{"line_number":1224,"context_line":"        ssh_client, f\u0027source /etc/platform/openrc; system host-list | grep {hostname}\u0027, timeout\u003d30)"}],"source_content_type":"text/x-python","patch_set":1,"id":"200a9144_339f1da7","line":1221,"updated":"2023-05-04 13:46:19.000000000","message":"Could this include information about the returned values as well?","commit_id":"0b5544a41e721b709d419edb875299fc9fd2bfc8"},{"author":{"_account_id":35944,"name":"Tomás Nascimento Pimentel Barros","display_name":"Tomás Barros","email":"tomas.barros@encora.com","username":"tomas_barros_encora"},"change_message_id":"19f806886f1b3a197ae9e6b9fc96796a195c8280","unresolved":false,"context_lines":[{"line_number":1218,"context_line":"def check_host_status(ssh_client, hostname, status):"},{"line_number":1219,"context_line":"    \u0027\u0027\u0027"},{"line_number":1220,"context_line":"    This function aims to check if some controller is unlocked, enabled and available"},{"line_number":1221,"context_line":"    using the grep linux tool"},{"line_number":1222,"context_line":"    \u0027\u0027\u0027"},{"line_number":1223,"context_line":"    host_statuses, _, _ \u003d run_ssh_cmd("},{"line_number":1224,"context_line":"        ssh_client, f\u0027source /etc/platform/openrc; system host-list | grep {hostname}\u0027, timeout\u003d30)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5050715c_b93feb2d","line":1221,"in_reply_to":"200a9144_339f1da7","updated":"2023-05-09 16:31:55.000000000","message":"Done","commit_id":"0b5544a41e721b709d419edb875299fc9fd2bfc8"},{"author":{"_account_id":35896,"name":"Bruno Drugowick Muniz","display_name":"Bruno","email":"bruno.muniz@encora.com","username":"brunomuniz"},"change_message_id":"97042c8e1805240219592d7cf16bd5ba546f8c72","unresolved":true,"context_lines":[{"line_number":1222,"context_line":"    \u0027\u0027\u0027"},{"line_number":1223,"context_line":"    host_statuses, _, _ \u003d run_ssh_cmd("},{"line_number":1224,"context_line":"        ssh_client, f\u0027source /etc/platform/openrc; system host-list | grep {hostname}\u0027, timeout\u003d30)"},{"line_number":1225,"context_line":"    host_statuses \u003d host_statuses[0:-1]"},{"line_number":1226,"context_line":"    host_statuses \u003d [host_status.split(\u0027|\u0027)[4:7] for host_status in host_statuses]"},{"line_number":1227,"context_line":""},{"line_number":1228,"context_line":"    valid_node \u003d True"}],"source_content_type":"text/x-python","patch_set":1,"id":"8baa4210_71935696","line":1225,"updated":"2023-05-04 13:46:19.000000000","message":"Why is this slicing necessary?","commit_id":"0b5544a41e721b709d419edb875299fc9fd2bfc8"},{"author":{"_account_id":35896,"name":"Bruno Drugowick Muniz","display_name":"Bruno","email":"bruno.muniz@encora.com","username":"brunomuniz"},"change_message_id":"c75e57f061b268ad8561351c09544c27a18a6cec","unresolved":true,"context_lines":[{"line_number":1222,"context_line":"    \u0027\u0027\u0027"},{"line_number":1223,"context_line":"    host_statuses, _, _ \u003d run_ssh_cmd("},{"line_number":1224,"context_line":"        ssh_client, f\u0027source /etc/platform/openrc; system host-list | grep {hostname}\u0027, timeout\u003d30)"},{"line_number":1225,"context_line":"    host_statuses \u003d host_statuses[0:-1]"},{"line_number":1226,"context_line":"    host_statuses \u003d [host_status.split(\u0027|\u0027)[4:7] for host_status in host_statuses]"},{"line_number":1227,"context_line":""},{"line_number":1228,"context_line":"    valid_node \u003d True"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fa29d6e_f6f2c0fa","line":1225,"in_reply_to":"424610cd_ff30886c","updated":"2023-05-10 19:03:12.000000000","message":"I think you explained this to me already, but would you mind adding a small explanation here in case someone else has the same question?","commit_id":"0b5544a41e721b709d419edb875299fc9fd2bfc8"},{"author":{"_account_id":35944,"name":"Tomás Nascimento Pimentel Barros","display_name":"Tomás Barros","email":"tomas.barros@encora.com","username":"tomas_barros_encora"},"change_message_id":"19f806886f1b3a197ae9e6b9fc96796a195c8280","unresolved":false,"context_lines":[{"line_number":1222,"context_line":"    \u0027\u0027\u0027"},{"line_number":1223,"context_line":"    host_statuses, _, _ \u003d run_ssh_cmd("},{"line_number":1224,"context_line":"        ssh_client, f\u0027source /etc/platform/openrc; system host-list | grep {hostname}\u0027, timeout\u003d30)"},{"line_number":1225,"context_line":"    host_statuses \u003d host_statuses[0:-1]"},{"line_number":1226,"context_line":"    host_statuses \u003d [host_status.split(\u0027|\u0027)[4:7] for host_status in host_statuses]"},{"line_number":1227,"context_line":""},{"line_number":1228,"context_line":"    valid_node \u003d True"}],"source_content_type":"text/x-python","patch_set":1,"id":"424610cd_ff30886c","line":1225,"in_reply_to":"8baa4210_71935696","updated":"2023-05-09 16:31:55.000000000","message":"Done","commit_id":"0b5544a41e721b709d419edb875299fc9fd2bfc8"},{"author":{"_account_id":35944,"name":"Tomás Nascimento Pimentel Barros","display_name":"Tomás Barros","email":"tomas.barros@encora.com","username":"tomas_barros_encora"},"change_message_id":"f0e1c246ba23c11748f4d42e1ca5de8bb05fc1a2","unresolved":false,"context_lines":[{"line_number":1222,"context_line":"    \u0027\u0027\u0027"},{"line_number":1223,"context_line":"    host_statuses, _, _ \u003d run_ssh_cmd("},{"line_number":1224,"context_line":"        ssh_client, f\u0027source /etc/platform/openrc; system host-list | grep {hostname}\u0027, timeout\u003d30)"},{"line_number":1225,"context_line":"    host_statuses \u003d host_statuses[0:-1]"},{"line_number":1226,"context_line":"    host_statuses \u003d [host_status.split(\u0027|\u0027)[4:7] for host_status in host_statuses]"},{"line_number":1227,"context_line":""},{"line_number":1228,"context_line":"    valid_node \u003d True"}],"source_content_type":"text/x-python","patch_set":1,"id":"b50a7fc4_72dfcbd6","line":1225,"in_reply_to":"9fa29d6e_f6f2c0fa","updated":"2023-05-16 16:58:32.000000000","message":"This part of the code was removed","commit_id":"0b5544a41e721b709d419edb875299fc9fd2bfc8"},{"author":{"_account_id":35896,"name":"Bruno Drugowick Muniz","display_name":"Bruno","email":"bruno.muniz@encora.com","username":"brunomuniz"},"change_message_id":"97042c8e1805240219592d7cf16bd5ba546f8c72","unresolved":true,"context_lines":[{"line_number":1231,"context_line":""},{"line_number":1232,"context_line":"    for l_sts in host_statuses:"},{"line_number":1233,"context_line":"        for i,sts in enumerate(l_sts):"},{"line_number":1234,"context_line":"            l_sts[i] \u003d sts.strip()"},{"line_number":1235,"context_line":""},{"line_number":1236,"context_line":"    for host_status in host_statuses:"},{"line_number":1237,"context_line":"        if not status in host_status:"}],"source_content_type":"text/x-python","patch_set":1,"id":"acc6110b_6a792d64","line":1234,"updated":"2023-05-04 13:46:19.000000000","message":"Do we really need the inner loop? Can\u0027t we strip directly the `l_sts` value?\n\nI\u0027m assuming `l_sts` holds something like `      available     ` (with lots of spaces around it).","commit_id":"0b5544a41e721b709d419edb875299fc9fd2bfc8"},{"author":{"_account_id":35944,"name":"Tomás Nascimento Pimentel Barros","display_name":"Tomás Barros","email":"tomas.barros@encora.com","username":"tomas_barros_encora"},"change_message_id":"f0e1c246ba23c11748f4d42e1ca5de8bb05fc1a2","unresolved":false,"context_lines":[{"line_number":1231,"context_line":""},{"line_number":1232,"context_line":"    for l_sts in host_statuses:"},{"line_number":1233,"context_line":"        for i,sts in enumerate(l_sts):"},{"line_number":1234,"context_line":"            l_sts[i] \u003d sts.strip()"},{"line_number":1235,"context_line":""},{"line_number":1236,"context_line":"    for host_status in host_statuses:"},{"line_number":1237,"context_line":"        if not status in host_status:"}],"source_content_type":"text/x-python","patch_set":1,"id":"260ff5f7_a017a6f6","line":1234,"in_reply_to":"842f81c0_1e20d9b0","updated":"2023-05-16 16:58:32.000000000","message":"This part of the code was removed","commit_id":"0b5544a41e721b709d419edb875299fc9fd2bfc8"},{"author":{"_account_id":35944,"name":"Tomás Nascimento Pimentel Barros","display_name":"Tomás Barros","email":"tomas.barros@encora.com","username":"tomas_barros_encora"},"change_message_id":"19f806886f1b3a197ae9e6b9fc96796a195c8280","unresolved":false,"context_lines":[{"line_number":1231,"context_line":""},{"line_number":1232,"context_line":"    for l_sts in host_statuses:"},{"line_number":1233,"context_line":"        for i,sts in enumerate(l_sts):"},{"line_number":1234,"context_line":"            l_sts[i] \u003d sts.strip()"},{"line_number":1235,"context_line":""},{"line_number":1236,"context_line":"    for host_status in host_statuses:"},{"line_number":1237,"context_line":"        if not status in host_status:"}],"source_content_type":"text/x-python","patch_set":1,"id":"f46786ef_bbe2bb23","line":1234,"in_reply_to":"acc6110b_6a792d64","updated":"2023-05-09 16:31:55.000000000","message":"Done","commit_id":"0b5544a41e721b709d419edb875299fc9fd2bfc8"},{"author":{"_account_id":35896,"name":"Bruno Drugowick Muniz","display_name":"Bruno","email":"bruno.muniz@encora.com","username":"brunomuniz"},"change_message_id":"c75e57f061b268ad8561351c09544c27a18a6cec","unresolved":true,"context_lines":[{"line_number":1231,"context_line":""},{"line_number":1232,"context_line":"    for l_sts in host_statuses:"},{"line_number":1233,"context_line":"        for i,sts in enumerate(l_sts):"},{"line_number":1234,"context_line":"            l_sts[i] \u003d sts.strip()"},{"line_number":1235,"context_line":""},{"line_number":1236,"context_line":"    for host_status in host_statuses:"},{"line_number":1237,"context_line":"        if not status in host_status:"}],"source_content_type":"text/x-python","patch_set":1,"id":"842f81c0_1e20d9b0","line":1234,"in_reply_to":"f46786ef_bbe2bb23","updated":"2023-05-10 19:03:12.000000000","message":"I think you explained this to me already, but would you mind adding a small explanation here in case someone else has the same question?","commit_id":"0b5544a41e721b709d419edb875299fc9fd2bfc8"},{"author":{"_account_id":35967,"name":"Lindley Werner Soares Vieira","display_name":"Lindley Werner","email":"lindley.vieira@encora.com","username":"lindleywerner"},"change_message_id":"48513cad19381d316d0fa79316145a4b78ce9918","unresolved":true,"context_lines":[{"line_number":1203,"context_line":""},{"line_number":1204,"context_line":"    for hostname in hostnames:"},{"line_number":1205,"context_line":"        host_code, error_msgs \u003d 0, \u0027\u0027"},{"line_number":1206,"context_line":"        for status in statuses:"},{"line_number":1207,"context_line":"            code, msg \u003d check_host_status(ssh_client, hostname, status)"},{"line_number":1208,"context_line":"            host_code \u003d code is True"},{"line_number":1209,"context_line":"            error_msgs +\u003d msg"},{"line_number":1210,"context_line":"        if host_code is False:"},{"line_number":1211,"context_line":"            raise Exception(error_msgs)"},{"line_number":1212,"context_line":""},{"line_number":1213,"context_line":"        LOG.info(\u0027\u003d\u0027 * 121)"}],"source_content_type":"text/x-python","patch_set":4,"id":"22d29c2c_8e585270","line":1210,"range":{"start_line":1206,"start_character":8,"end_line":1210,"end_character":30},"updated":"2023-05-05 12:44:41.000000000","message":"This if statement should not be inside the statuses loop?\nImagine you have 2 statuses, the first is false and the second is true, the host_code will be set to false, then to true and just after that will be checked on if.","commit_id":"ad29670fee452b77963c5a9da60f89d8f799efa6"},{"author":{"_account_id":35944,"name":"Tomás Nascimento Pimentel Barros","display_name":"Tomás Barros","email":"tomas.barros@encora.com","username":"tomas_barros_encora"},"change_message_id":"19f806886f1b3a197ae9e6b9fc96796a195c8280","unresolved":false,"context_lines":[{"line_number":1203,"context_line":""},{"line_number":1204,"context_line":"    for hostname in hostnames:"},{"line_number":1205,"context_line":"        host_code, error_msgs \u003d 0, \u0027\u0027"},{"line_number":1206,"context_line":"        for status in statuses:"},{"line_number":1207,"context_line":"            code, msg \u003d check_host_status(ssh_client, hostname, status)"},{"line_number":1208,"context_line":"            host_code \u003d code is True"},{"line_number":1209,"context_line":"            error_msgs +\u003d msg"},{"line_number":1210,"context_line":"        if host_code is False:"},{"line_number":1211,"context_line":"            raise Exception(error_msgs)"},{"line_number":1212,"context_line":""},{"line_number":1213,"context_line":"        LOG.info(\u0027\u003d\u0027 * 121)"}],"source_content_type":"text/x-python","patch_set":4,"id":"6207a4f6_04586acf","line":1210,"range":{"start_line":1206,"start_character":8,"end_line":1210,"end_character":30},"in_reply_to":"22d29c2c_8e585270","updated":"2023-05-09 16:31:55.000000000","message":"Done","commit_id":"ad29670fee452b77963c5a9da60f89d8f799efa6"},{"author":{"_account_id":35967,"name":"Lindley Werner Soares Vieira","display_name":"Lindley Werner","email":"lindley.vieira@encora.com","username":"lindleywerner"},"change_message_id":"48513cad19381d316d0fa79316145a4b78ce9918","unresolved":true,"context_lines":[{"line_number":1231,"context_line":"    expected_statuses \u003d dict()"},{"line_number":1232,"context_line":"    error_msg \u003d \u0027\u0027"},{"line_number":1233,"context_line":""},{"line_number":1234,"context_line":"    for host_status in host_statuses:"},{"line_number":1235,"context_line":"        if not status in host_status:"},{"line_number":1236,"context_line":"            valid_node \u003d False"},{"line_number":1237,"context_line":"            expected_statuses[status] \u003d False"},{"line_number":1238,"context_line":""},{"line_number":1239,"context_line":"    if not valid_node:"},{"line_number":1240,"context_line":"        for key, val in expected_statuses.items():"},{"line_number":1241,"context_line":"            if not val:"},{"line_number":1242,"context_line":"                error_msg +\u003d f\u0027Error!!! {hostname} not in {status} state\\n\u0027"},{"line_number":1243,"context_line":"        return False, error_msg"},{"line_number":1244,"context_line":"    return True, \u0027\u0027"},{"line_number":1245,"context_line":""},{"line_number":1246,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3f1f1c04_46382df4","line":1243,"range":{"start_line":1234,"start_character":4,"end_line":1243,"end_character":31},"updated":"2023-05-05 12:44:41.000000000","message":"You can avoid the second loop this way\n\nfor host_status in host_statuses:\n--if not status in host_status:\n----error_msg +\u003d f\u0027Error!!! {hostname} not in {status} state\\n\u0027\n\nif error_msg:\n--return False, error_msg\nreturn True, \u0027\u0027\n\nI\u0027m seeing here the error messages will always be the same since the hostname and status do not change in this function scope. Is it intended?\nIn this case, you could simply do:\n\nfor host_status in host_statuses:\n--if not status in host_status:\n----return False, f\u0027Error!!! {hostname} not in {status} state\\n\u0027\nreturn True, \u0027\u0027","commit_id":"ad29670fee452b77963c5a9da60f89d8f799efa6"},{"author":{"_account_id":35944,"name":"Tomás Nascimento Pimentel Barros","display_name":"Tomás Barros","email":"tomas.barros@encora.com","username":"tomas_barros_encora"},"change_message_id":"19f806886f1b3a197ae9e6b9fc96796a195c8280","unresolved":false,"context_lines":[{"line_number":1231,"context_line":"    expected_statuses \u003d dict()"},{"line_number":1232,"context_line":"    error_msg \u003d \u0027\u0027"},{"line_number":1233,"context_line":""},{"line_number":1234,"context_line":"    for host_status in host_statuses:"},{"line_number":1235,"context_line":"        if not status in host_status:"},{"line_number":1236,"context_line":"            valid_node \u003d False"},{"line_number":1237,"context_line":"            expected_statuses[status] \u003d False"},{"line_number":1238,"context_line":""},{"line_number":1239,"context_line":"    if not valid_node:"},{"line_number":1240,"context_line":"        for key, val in expected_statuses.items():"},{"line_number":1241,"context_line":"            if not val:"},{"line_number":1242,"context_line":"                error_msg +\u003d f\u0027Error!!! {hostname} not in {status} state\\n\u0027"},{"line_number":1243,"context_line":"        return False, error_msg"},{"line_number":1244,"context_line":"    return True, \u0027\u0027"},{"line_number":1245,"context_line":""},{"line_number":1246,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"dc97471b_00540fa2","line":1243,"range":{"start_line":1234,"start_character":4,"end_line":1243,"end_character":31},"in_reply_to":"3f1f1c04_46382df4","updated":"2023-05-09 16:31:55.000000000","message":"Done","commit_id":"ad29670fee452b77963c5a9da60f89d8f799efa6"},{"author":{"_account_id":35967,"name":"Lindley Werner Soares Vieira","display_name":"Lindley Werner","email":"lindley.vieira@encora.com","username":"lindleywerner"},"change_message_id":"48513cad19381d316d0fa79316145a4b78ce9918","unresolved":true,"context_lines":[{"line_number":1260,"context_line":"            code, msg \u003d check_host_status(ssh_client, hostname, status)"},{"line_number":1261,"context_line":"            host_code \u003d code is True"},{"line_number":1262,"context_line":"            error_msgs +\u003d msg"},{"line_number":1263,"context_line":"        if host_code is False:"},{"line_number":1264,"context_line":"            raise Exception(error_msgs)"},{"line_number":1265,"context_line":""},{"line_number":1266,"context_line":"        LOG.info(\u0027\u003d\u0027 * 121)"},{"line_number":1267,"context_line":"        LOG.info(f\u0027{hostname} is unlocked, enabled and available\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1033de2e_29b26fac","line":1264,"range":{"start_line":1263,"start_character":8,"end_line":1264,"end_character":39},"updated":"2023-05-05 12:44:41.000000000","message":"Here the if is in the wright place!","commit_id":"ad29670fee452b77963c5a9da60f89d8f799efa6"},{"author":{"_account_id":35944,"name":"Tomás Nascimento Pimentel Barros","display_name":"Tomás Barros","email":"tomas.barros@encora.com","username":"tomas_barros_encora"},"change_message_id":"19f806886f1b3a197ae9e6b9fc96796a195c8280","unresolved":false,"context_lines":[{"line_number":1260,"context_line":"            code, msg \u003d check_host_status(ssh_client, hostname, status)"},{"line_number":1261,"context_line":"            host_code \u003d code is True"},{"line_number":1262,"context_line":"            error_msgs +\u003d msg"},{"line_number":1263,"context_line":"        if host_code is False:"},{"line_number":1264,"context_line":"            raise Exception(error_msgs)"},{"line_number":1265,"context_line":""},{"line_number":1266,"context_line":"        LOG.info(\u0027\u003d\u0027 * 121)"},{"line_number":1267,"context_line":"        LOG.info(f\u0027{hostname} is unlocked, enabled and available\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"0022f044_d8b7790b","line":1264,"range":{"start_line":1263,"start_character":8,"end_line":1264,"end_character":39},"in_reply_to":"1033de2e_29b26fac","updated":"2023-05-09 16:31:55.000000000","message":"Done","commit_id":"ad29670fee452b77963c5a9da60f89d8f799efa6"},{"author":{"_account_id":35967,"name":"Lindley Werner Soares Vieira","display_name":"Lindley Werner","email":"lindley.vieira@encora.com","username":"lindleywerner"},"change_message_id":"48513cad19381d316d0fa79316145a4b78ce9918","unresolved":true,"context_lines":[{"line_number":1244,"context_line":"    return True, \u0027\u0027"},{"line_number":1245,"context_line":""},{"line_number":1246,"context_line":""},{"line_number":1247,"context_line":"@connect_to_ssh"},{"line_number":1248,"context_line":"def check_hosts_statuses(ssh_client):"},{"line_number":1249,"context_line":"    \u0027\u0027\u0027"},{"line_number":1250,"context_line":"    This function aims to check if all hosts are unlocked, enabled and available"},{"line_number":1251,"context_line":"    in the post installation stage. Raise an exception if node is not"},{"line_number":1252,"context_line":"    in the expected conditions."},{"line_number":1253,"context_line":"    \u0027\u0027\u0027"},{"line_number":1254,"context_line":"    statuses\u003d[\"unlocked\", \"enabled\", \"available\"]"},{"line_number":1255,"context_line":"    hostnames \u003d get_hostnames().values()"},{"line_number":1256,"context_line":""},{"line_number":1257,"context_line":"    for hostname in hostnames:"},{"line_number":1258,"context_line":"        host_code, error_msgs \u003d 0, \u0027\u0027"},{"line_number":1259,"context_line":"        for status in statuses:"},{"line_number":1260,"context_line":"            code, msg \u003d check_host_status(ssh_client, hostname, status)"},{"line_number":1261,"context_line":"            host_code \u003d code is True"},{"line_number":1262,"context_line":"            error_msgs +\u003d msg"},{"line_number":1263,"context_line":"        if host_code is False:"},{"line_number":1264,"context_line":"            raise Exception(error_msgs)"},{"line_number":1265,"context_line":""},{"line_number":1266,"context_line":"        LOG.info(\u0027\u003d\u0027 * 121)"},{"line_number":1267,"context_line":"        LOG.info(f\u0027{hostname} is unlocked, enabled and available\u0027)"},{"line_number":1268,"context_line":"        LOG.info(\u0027\u003d\u0027 * 121)"},{"line_number":1269,"context_line":""},{"line_number":1270,"context_line":""},{"line_number":1271,"context_line":"def check_host_status(ssh_client, hostname, status):"},{"line_number":1272,"context_line":"    \u0027\u0027\u0027"},{"line_number":1273,"context_line":"    This function aims to check if some host is unlocked, enabled and available"},{"line_number":1274,"context_line":"    using the grep linux tool."},{"line_number":1275,"context_line":"    If host is in expected statuses, the function returns True, if some unexpected"},{"line_number":1276,"context_line":"    status appears, It returns False and info about the status."},{"line_number":1277,"context_line":"    \u0027\u0027\u0027"},{"line_number":1278,"context_line":"    host_statuses, _, _ \u003d run_ssh_cmd("},{"line_number":1279,"context_line":"        ssh_client, f\u0027source /etc/platform/openrc; system host-list | grep {hostname}\u0027, timeout\u003d30)"},{"line_number":1280,"context_line":"    host_statuses \u003d host_statuses[0].split(\u0027|\u0027)[4:7]"},{"line_number":1281,"context_line":"    host_statuses \u003d list(map(lambda _str : _str.strip(), host_statuses))"},{"line_number":1282,"context_line":""},{"line_number":1283,"context_line":"    with open(\u0027out.txt\u0027, \u0027w\u0027) as f:"},{"line_number":1284,"context_line":"        f.write(str(host_statuses) + \u0027\\n\u0027+ str(status))"},{"line_number":1285,"context_line":""},{"line_number":1286,"context_line":"    valid_node \u003d True"},{"line_number":1287,"context_line":"    expected_statuses \u003d dict()"},{"line_number":1288,"context_line":"    error_msg \u003d \u0027\u0027"},{"line_number":1289,"context_line":""},{"line_number":1290,"context_line":"    if status not in host_statuses:"},{"line_number":1291,"context_line":"        valid_node \u003d False"},{"line_number":1292,"context_line":"        expected_statuses[status] \u003d False"},{"line_number":1293,"context_line":""},{"line_number":1294,"context_line":"    if not valid_node:"},{"line_number":1295,"context_line":"        for key, val in expected_statuses.items():"},{"line_number":1296,"context_line":"            if not val:"},{"line_number":1297,"context_line":"                error_msg +\u003d f\u0027Error!!! {hostname} not in {status} state\\n\u0027"},{"line_number":1298,"context_line":"        return False, error_msg"},{"line_number":1299,"context_line":"    return True, \u0027\u0027"},{"line_number":1300,"context_line":""},{"line_number":1301,"context_line":"STG_CREATE_LAB \u003d \"create-lab\""},{"line_number":1302,"context_line":"STG_INSTALL_CONTROLLER0 \u003d \"install-controller-0\""}],"source_content_type":"text/x-python","patch_set":4,"id":"4b80b5ee_d4bf7f2a","line":1299,"range":{"start_line":1247,"start_character":0,"end_line":1299,"end_character":19},"updated":"2023-05-05 12:44:41.000000000","message":"This code is duplicated!","commit_id":"ad29670fee452b77963c5a9da60f89d8f799efa6"},{"author":{"_account_id":35944,"name":"Tomás Nascimento Pimentel Barros","display_name":"Tomás Barros","email":"tomas.barros@encora.com","username":"tomas_barros_encora"},"change_message_id":"19f806886f1b3a197ae9e6b9fc96796a195c8280","unresolved":false,"context_lines":[{"line_number":1244,"context_line":"    return True, \u0027\u0027"},{"line_number":1245,"context_line":""},{"line_number":1246,"context_line":""},{"line_number":1247,"context_line":"@connect_to_ssh"},{"line_number":1248,"context_line":"def check_hosts_statuses(ssh_client):"},{"line_number":1249,"context_line":"    \u0027\u0027\u0027"},{"line_number":1250,"context_line":"    This function aims to check if all hosts are unlocked, enabled and available"},{"line_number":1251,"context_line":"    in the post installation stage. Raise an exception if node is not"},{"line_number":1252,"context_line":"    in the expected conditions."},{"line_number":1253,"context_line":"    \u0027\u0027\u0027"},{"line_number":1254,"context_line":"    statuses\u003d[\"unlocked\", \"enabled\", \"available\"]"},{"line_number":1255,"context_line":"    hostnames \u003d get_hostnames().values()"},{"line_number":1256,"context_line":""},{"line_number":1257,"context_line":"    for hostname in hostnames:"},{"line_number":1258,"context_line":"        host_code, error_msgs \u003d 0, \u0027\u0027"},{"line_number":1259,"context_line":"        for status in statuses:"},{"line_number":1260,"context_line":"            code, msg \u003d check_host_status(ssh_client, hostname, status)"},{"line_number":1261,"context_line":"            host_code \u003d code is True"},{"line_number":1262,"context_line":"            error_msgs +\u003d msg"},{"line_number":1263,"context_line":"        if host_code is False:"},{"line_number":1264,"context_line":"            raise Exception(error_msgs)"},{"line_number":1265,"context_line":""},{"line_number":1266,"context_line":"        LOG.info(\u0027\u003d\u0027 * 121)"},{"line_number":1267,"context_line":"        LOG.info(f\u0027{hostname} is unlocked, enabled and available\u0027)"},{"line_number":1268,"context_line":"        LOG.info(\u0027\u003d\u0027 * 121)"},{"line_number":1269,"context_line":""},{"line_number":1270,"context_line":""},{"line_number":1271,"context_line":"def check_host_status(ssh_client, hostname, status):"},{"line_number":1272,"context_line":"    \u0027\u0027\u0027"},{"line_number":1273,"context_line":"    This function aims to check if some host is unlocked, enabled and available"},{"line_number":1274,"context_line":"    using the grep linux tool."},{"line_number":1275,"context_line":"    If host is in expected statuses, the function returns True, if some unexpected"},{"line_number":1276,"context_line":"    status appears, It returns False and info about the status."},{"line_number":1277,"context_line":"    \u0027\u0027\u0027"},{"line_number":1278,"context_line":"    host_statuses, _, _ \u003d run_ssh_cmd("},{"line_number":1279,"context_line":"        ssh_client, f\u0027source /etc/platform/openrc; system host-list | grep {hostname}\u0027, timeout\u003d30)"},{"line_number":1280,"context_line":"    host_statuses \u003d host_statuses[0].split(\u0027|\u0027)[4:7]"},{"line_number":1281,"context_line":"    host_statuses \u003d list(map(lambda _str : _str.strip(), host_statuses))"},{"line_number":1282,"context_line":""},{"line_number":1283,"context_line":"    with open(\u0027out.txt\u0027, \u0027w\u0027) as f:"},{"line_number":1284,"context_line":"        f.write(str(host_statuses) + \u0027\\n\u0027+ str(status))"},{"line_number":1285,"context_line":""},{"line_number":1286,"context_line":"    valid_node \u003d True"},{"line_number":1287,"context_line":"    expected_statuses \u003d dict()"},{"line_number":1288,"context_line":"    error_msg \u003d \u0027\u0027"},{"line_number":1289,"context_line":""},{"line_number":1290,"context_line":"    if status not in host_statuses:"},{"line_number":1291,"context_line":"        valid_node \u003d False"},{"line_number":1292,"context_line":"        expected_statuses[status] \u003d False"},{"line_number":1293,"context_line":""},{"line_number":1294,"context_line":"    if not valid_node:"},{"line_number":1295,"context_line":"        for key, val in expected_statuses.items():"},{"line_number":1296,"context_line":"            if not val:"},{"line_number":1297,"context_line":"                error_msg +\u003d f\u0027Error!!! {hostname} not in {status} state\\n\u0027"},{"line_number":1298,"context_line":"        return False, error_msg"},{"line_number":1299,"context_line":"    return True, \u0027\u0027"},{"line_number":1300,"context_line":""},{"line_number":1301,"context_line":"STG_CREATE_LAB \u003d \"create-lab\""},{"line_number":1302,"context_line":"STG_INSTALL_CONTROLLER0 \u003d \"install-controller-0\""}],"source_content_type":"text/x-python","patch_set":4,"id":"9726c0ff_9a4de6dc","line":1299,"range":{"start_line":1247,"start_character":0,"end_line":1299,"end_character":19},"in_reply_to":"4b80b5ee_d4bf7f2a","updated":"2023-05-09 16:31:55.000000000","message":"Done","commit_id":"ad29670fee452b77963c5a9da60f89d8f799efa6"},{"author":{"_account_id":35896,"name":"Bruno Drugowick Muniz","display_name":"Bruno","email":"bruno.muniz@encora.com","username":"brunomuniz"},"change_message_id":"06548b5d356705909dd65a955df8d7e7d9d1d057","unresolved":false,"context_lines":[{"line_number":1331,"context_line":"               \"upload it in the rsync-config stage and it is +x. See help.\"},"},{"line_number":1332,"context_line":"    STG_CHECK_STATUS:"},{"line_number":1333,"context_line":"        {CALLBACK: check_hosts_statuses,"},{"line_number":1334,"context_line":"         HELP: \"Check if host is in a unlocked, enabled and available state\"},"},{"line_number":1335,"context_line":""},{"line_number":1336,"context_line":"    # internal testing"},{"line_number":1337,"context_line":"    STC_TEST_SUCCESS: {CALLBACK: stage_test_success,"}],"source_content_type":"text/x-python","patch_set":7,"id":"a49c5cda_044f07f4","line":1334,"updated":"2023-05-09 19:56:28.000000000","message":"nitpick: \"Check if host(s) is(are) unlocked, enabled and available\".","commit_id":"3ab43f2296284e4bab758b0e53ed504d20d516e3"},{"author":{"_account_id":35896,"name":"Bruno Drugowick Muniz","display_name":"Bruno","email":"bruno.muniz@encora.com","username":"brunomuniz"},"change_message_id":"fa1581d378d750679f5042929d0932505d5e172f","unresolved":true,"context_lines":[{"line_number":1208,"context_line":"        host_code, error_msgs \u003d False, \u0027\u0027"},{"line_number":1209,"context_line":"        for status in statuses:"},{"line_number":1210,"context_line":"            code, msg \u003d check_host_status(ssh_client, hostname, status)"},{"line_number":1211,"context_line":"            host_code \u003d code is True"},{"line_number":1212,"context_line":"            error_msgs +\u003d msg"},{"line_number":1213,"context_line":"            if host_code is False:"},{"line_number":1214,"context_line":"                raise Exception(error_msgs)"}],"source_content_type":"text/x-python","patch_set":10,"id":"58e3a611_dbbd9a90","line":1211,"updated":"2023-05-10 19:06:09.000000000","message":"Is this a pylint thing or just a silly mistake? Couldn\u0027t this be just `host_code \u003d code`.\n\nEDIT: thinking again, can\u0027t you just het the response from `check_host_status` directly into `host_code`?","commit_id":"696dc56fa0b2bc077681c924eb31608c5ef94646"},{"author":{"_account_id":35944,"name":"Tomás Nascimento Pimentel Barros","display_name":"Tomás Barros","email":"tomas.barros@encora.com","username":"tomas_barros_encora"},"change_message_id":"f0e1c246ba23c11748f4d42e1ca5de8bb05fc1a2","unresolved":false,"context_lines":[{"line_number":1208,"context_line":"        host_code, error_msgs \u003d False, \u0027\u0027"},{"line_number":1209,"context_line":"        for status in statuses:"},{"line_number":1210,"context_line":"            code, msg \u003d check_host_status(ssh_client, hostname, status)"},{"line_number":1211,"context_line":"            host_code \u003d code is True"},{"line_number":1212,"context_line":"            error_msgs +\u003d msg"},{"line_number":1213,"context_line":"            if host_code is False:"},{"line_number":1214,"context_line":"                raise Exception(error_msgs)"}],"source_content_type":"text/x-python","patch_set":10,"id":"2197f9eb_f7ca1b90","line":1211,"in_reply_to":"58e3a611_dbbd9a90","updated":"2023-05-16 16:58:32.000000000","message":"This is not an assignment expression, It\u0027s a boolean comparation, but I\u0027ll make it more Pythonic","commit_id":"696dc56fa0b2bc077681c924eb31608c5ef94646"},{"author":{"_account_id":35896,"name":"Bruno Drugowick Muniz","display_name":"Bruno","email":"bruno.muniz@encora.com","username":"brunomuniz"},"change_message_id":"3b80c2f710441d49df4cfce949107c0fc0e7ce9e","unresolved":true,"context_lines":[{"line_number":1218,"context_line":"    \u0027\u0027\u0027"},{"line_number":1219,"context_line":"    This function aims to check if some host is unlocked, enabled and available"},{"line_number":1220,"context_line":"    using the grep linux tool ."},{"line_number":1221,"context_line":"    If host is in expected statuses, the function returns True, otherwise It"},{"line_number":1222,"context_line":"    returns False."},{"line_number":1223,"context_line":"    \u0027\u0027\u0027"},{"line_number":1224,"context_line":"    host_statuses, _, _ \u003d run_ssh_cmd("}],"source_content_type":"text/x-python","patch_set":12,"id":"0f5d075c_22dcab65","line":1221,"updated":"2023-05-29 17:07:41.000000000","message":"nit: \"it\" instead of \"It\"","commit_id":"5369ad19cd70f644d5f726070d351f404c743eba"},{"author":{"_account_id":35944,"name":"Tomás Nascimento Pimentel Barros","display_name":"Tomás Barros","email":"tomas.barros@encora.com","username":"tomas_barros_encora"},"change_message_id":"027a660b54c09259d6d3e960bd0e6f833cb955cf","unresolved":false,"context_lines":[{"line_number":1218,"context_line":"    \u0027\u0027\u0027"},{"line_number":1219,"context_line":"    This function aims to check if some host is unlocked, enabled and available"},{"line_number":1220,"context_line":"    using the grep linux tool ."},{"line_number":1221,"context_line":"    If host is in expected statuses, the function returns True, otherwise It"},{"line_number":1222,"context_line":"    returns False."},{"line_number":1223,"context_line":"    \u0027\u0027\u0027"},{"line_number":1224,"context_line":"    host_statuses, _, _ \u003d run_ssh_cmd("}],"source_content_type":"text/x-python","patch_set":12,"id":"e6373e31_c16327df","line":1221,"in_reply_to":"0f5d075c_22dcab65","updated":"2023-05-30 22:01:52.000000000","message":"Done","commit_id":"5369ad19cd70f644d5f726070d351f404c743eba"},{"author":{"_account_id":35896,"name":"Bruno Drugowick Muniz","display_name":"Bruno","email":"bruno.muniz@encora.com","username":"brunomuniz"},"change_message_id":"62574dc5c20d1211d35f5d989fab7bf95c2e6259","unresolved":true,"context_lines":[{"line_number":703,"context_line":""},{"line_number":704,"context_line":"def connect_to_ssh(func):"},{"line_number":705,"context_line":"    def func_wrapper(*args, **kwargs):"},{"line_number":706,"context_line":"        ssh \u003d _connect_to_ssh()"},{"line_number":707,"context_line":"        try:"},{"line_number":708,"context_line":"            ssh \u003d _connect_to_ssh()"},{"line_number":709,"context_line":"            kwargs[\u0027ssh_client\u0027] \u003d ssh"}],"source_content_type":"text/x-python","patch_set":14,"id":"46edd4a1_d4f6cb67","line":706,"updated":"2023-05-31 13:37:51.000000000","message":"Why was this line added here if it\u0027s called inside the `try` right after?","commit_id":"6b3991280ca0b5501b12f5ed55579d5025095dc6"},{"author":{"_account_id":35944,"name":"Tomás Nascimento Pimentel Barros","display_name":"Tomás Barros","email":"tomas.barros@encora.com","username":"tomas_barros_encora"},"change_message_id":"fc51e7588eb27708899757f367e020c9dd0c4afb","unresolved":false,"context_lines":[{"line_number":703,"context_line":""},{"line_number":704,"context_line":"def connect_to_ssh(func):"},{"line_number":705,"context_line":"    def func_wrapper(*args, **kwargs):"},{"line_number":706,"context_line":"        ssh \u003d _connect_to_ssh()"},{"line_number":707,"context_line":"        try:"},{"line_number":708,"context_line":"            ssh \u003d _connect_to_ssh()"},{"line_number":709,"context_line":"            kwargs[\u0027ssh_client\u0027] \u003d ssh"}],"source_content_type":"text/x-python","patch_set":14,"id":"1d903fa7_da4e599b","line":706,"in_reply_to":"46edd4a1_d4f6cb67","updated":"2023-06-01 16:56:52.000000000","message":"Done","commit_id":"6b3991280ca0b5501b12f5ed55579d5025095dc6"},{"author":{"_account_id":35967,"name":"Lindley Werner Soares Vieira","display_name":"Lindley Werner","email":"lindley.vieira@encora.com","username":"lindleywerner"},"change_message_id":"940c8405d30e6ca0d40cb978f94c603fc4e3f844","unresolved":true,"context_lines":[{"line_number":1201,"context_line":""},{"line_number":1202,"context_line":"@connect_to_ssh"},{"line_number":1203,"context_line":"def check_hosts_statuses(ssh_client):"},{"line_number":1204,"context_line":"    \u0027\u0027\u0027"},{"line_number":1205,"context_line":"    This function aims to check if all hosts are unlocked, enabled and available"},{"line_number":1206,"context_line":"    in the post installation stage. Else, raises an exception if node is not"},{"line_number":1207,"context_line":"    in the expected conditions."}],"source_content_type":"text/x-python","patch_set":19,"id":"fe0a4661_f7d5c32a","line":1204,"range":{"start_line":1204,"start_character":4,"end_line":1204,"end_character":7},"updated":"2023-06-21 14:22:18.000000000","message":"Pep8 requires triple double-quoted for docstring\n\"\"\"\nDocstring\n\"\"\"","commit_id":"f9819fdc47f160e7d00ec6f5288be94c1950a00c"},{"author":{"_account_id":35967,"name":"Lindley Werner Soares Vieira","display_name":"Lindley Werner","email":"lindley.vieira@encora.com","username":"lindleywerner"},"change_message_id":"940c8405d30e6ca0d40cb978f94c603fc4e3f844","unresolved":true,"context_lines":[{"line_number":1206,"context_line":"    in the post installation stage. Else, raises an exception if node is not"},{"line_number":1207,"context_line":"    in the expected conditions."},{"line_number":1208,"context_line":"    \u0027\u0027\u0027"},{"line_number":1209,"context_line":"    statuses\u003d[\"unlocked\", \"enabled\", \"available\"]"},{"line_number":1210,"context_line":"    hostnames \u003d get_hostnames().values()"},{"line_number":1211,"context_line":""},{"line_number":1212,"context_line":"    if len(hostnames) \u003d\u003d 0:"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a033348_70048cff","line":1209,"range":{"start_line":1209,"start_character":12,"end_line":1209,"end_character":13},"updated":"2023-06-21 14:22:18.000000000","message":"Pep8 requires white space before and after \u003d sign","commit_id":"f9819fdc47f160e7d00ec6f5288be94c1950a00c"},{"author":{"_account_id":35896,"name":"Bruno Drugowick Muniz","display_name":"Bruno","email":"bruno.muniz@encora.com","username":"brunomuniz"},"change_message_id":"38a69334345f1da2ebce861b905756d763a62e77","unresolved":true,"context_lines":[{"line_number":1206,"context_line":"    in the post installation stage. Else, raises an exception if node is not"},{"line_number":1207,"context_line":"    in the expected conditions."},{"line_number":1208,"context_line":"    \u0027\u0027\u0027"},{"line_number":1209,"context_line":"    statuses\u003d[\"unlocked\", \"enabled\", \"available\"]"},{"line_number":1210,"context_line":"    hostnames \u003d get_hostnames().values()"},{"line_number":1211,"context_line":""},{"line_number":1212,"context_line":"    if len(hostnames) \u003d\u003d 0:"}],"source_content_type":"text/x-python","patch_set":19,"id":"47179526_f7352614","line":1209,"updated":"2023-06-22 19:11:16.000000000","message":"We might not want to enforce the need for the `available` state here, since a state of `degraded` doesn\u0027t necessarily mean a problem that we can\u0027t live with (it might be an alarm that\u0027s irrelevant during the installation process or that\u0027s caused by the limited resources provided to the Virtual Machine).","commit_id":"f9819fdc47f160e7d00ec6f5288be94c1950a00c"},{"author":{"_account_id":35967,"name":"Lindley Werner Soares Vieira","display_name":"Lindley Werner","email":"lindley.vieira@encora.com","username":"lindleywerner"},"change_message_id":"940c8405d30e6ca0d40cb978f94c603fc4e3f844","unresolved":true,"context_lines":[{"line_number":1223,"context_line":""},{"line_number":1224,"context_line":""},{"line_number":1225,"context_line":"def check_host_status(ssh_client, hostname, statuses):"},{"line_number":1226,"context_line":"    \u0027\u0027\u0027"},{"line_number":1227,"context_line":"    This function aims to check if some host is unlocked, enabled and available"},{"line_number":1228,"context_line":"    using the grep linux tool ."},{"line_number":1229,"context_line":"    If host is in expected statuses, the function returns True, otherwise it"}],"source_content_type":"text/x-python","patch_set":19,"id":"3d773779_d1018dac","line":1226,"range":{"start_line":1226,"start_character":4,"end_line":1226,"end_character":7},"updated":"2023-06-21 14:22:18.000000000","message":"Pep8 requires triple double-quoted for docstring\n\"\"\"\nDocstring\n\"\"\"","commit_id":"f9819fdc47f160e7d00ec6f5288be94c1950a00c"}],"deployment/virtualbox/pybox/test_hosts.py":[{"author":{"_account_id":35967,"name":"Lindley Werner Soares Vieira","display_name":"Lindley Werner","email":"lindley.vieira@encora.com","username":"lindleywerner"},"change_message_id":"940c8405d30e6ca0d40cb978f94c603fc4e3f844","unresolved":true,"context_lines":[{"line_number":34,"context_line":"        install_vbox.run_ssh_cmd.assert_called_once_with("},{"line_number":35,"context_line":"            MOCK_SSH,"},{"line_number":36,"context_line":"            f\u0027source /etc/platform/openrc; system host-list | grep {self.MOCK_HOSTNAME}\u0027,"},{"line_number":37,"context_line":"            self.MOCK_TIMEOUT)"},{"line_number":38,"context_line":"        self.assertEqual(state, True, self.UNEXPECTED_STATES_MSG)"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def test_check_host_status_with_unexpected_format(self):"}],"source_content_type":"text/x-python","patch_set":19,"id":"479e1454_c87a4c05","line":37,"range":{"start_line":37,"start_character":12,"end_line":37,"end_character":29},"updated":"2023-06-21 14:22:18.000000000","message":"This call is not matching the actual and expected.\nUse:\ntimeout\u003dself.MOCK_TIMEOUT\n\nor better\nfrom unittest.mock import ANY\ntimeout\u003dANY","commit_id":"f9819fdc47f160e7d00ec6f5288be94c1950a00c"},{"author":{"_account_id":35967,"name":"Lindley Werner Soares Vieira","display_name":"Lindley Werner","email":"lindley.vieira@encora.com","username":"lindleywerner"},"change_message_id":"940c8405d30e6ca0d40cb978f94c603fc4e3f844","unresolved":true,"context_lines":[{"line_number":53,"context_line":"        install_vbox.run_ssh_cmd.assert_called_once_with("},{"line_number":54,"context_line":"            MOCK_SSH,"},{"line_number":55,"context_line":"            f\u0027source /etc/platform/openrc; system host-list | grep {self.MOCK_HOSTNAME}\u0027,"},{"line_number":56,"context_line":"            self.MOCK_TIMEOUT)"},{"line_number":57,"context_line":"        self.assertEqual(state, False, self.UNEXPECTED_STATES_MSG)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def test_check_host_status_with_unexpected_host_statuses(self):"}],"source_content_type":"text/x-python","patch_set":19,"id":"fe691d49_5b847d91","line":56,"range":{"start_line":56,"start_character":12,"end_line":56,"end_character":29},"updated":"2023-06-21 14:22:18.000000000","message":"This call is not matching the actual and expected.\nUse:\ntimeout\u003dself.MOCK_TIMEOUT\n\nor better\nfrom unittest.mock import ANY\ntimeout\u003dANY","commit_id":"f9819fdc47f160e7d00ec6f5288be94c1950a00c"},{"author":{"_account_id":35967,"name":"Lindley Werner Soares Vieira","display_name":"Lindley Werner","email":"lindley.vieira@encora.com","username":"lindleywerner"},"change_message_id":"940c8405d30e6ca0d40cb978f94c603fc4e3f844","unresolved":true,"context_lines":[{"line_number":72,"context_line":"        install_vbox.run_ssh_cmd.assert_called_once_with("},{"line_number":73,"context_line":"            MOCK_SSH,"},{"line_number":74,"context_line":"            f\u0027source /etc/platform/openrc; system host-list | grep {self.MOCK_HOSTNAME}\u0027,"},{"line_number":75,"context_line":"            self.MOCK_TIMEOUT)"},{"line_number":76,"context_line":"        self.assertEqual(state, False, self.UNEXPECTED_STATES_MSG)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"952ad761_ba125cc1","line":75,"range":{"start_line":75,"start_character":12,"end_line":75,"end_character":29},"updated":"2023-06-21 14:22:18.000000000","message":"This call is not matching the actual and expected.\nUse:\ntimeout\u003dself.MOCK_TIMEOUT\n\nor better\nfrom unittest.mock import ANY\ntimeout\u003dANY","commit_id":"f9819fdc47f160e7d00ec6f5288be94c1950a00c"},{"author":{"_account_id":35967,"name":"Lindley Werner Soares Vieira","display_name":"Lindley Werner","email":"lindley.vieira@encora.com","username":"lindleywerner"},"change_message_id":"940c8405d30e6ca0d40cb978f94c603fc4e3f844","unresolved":true,"context_lines":[{"line_number":86,"context_line":"        \"\"\""},{"line_number":87,"context_line":"        Test check_hosts_statuses when all the hosts are with the expected statuses"},{"line_number":88,"context_line":"        \"\"\""},{"line_number":89,"context_line":"        "},{"line_number":90,"context_line":"        # Setup"},{"line_number":91,"context_line":"        install_vbox.connect_to_ssh \u003d MagicMock()"},{"line_number":92,"context_line":"        install_vbox._connect_to_ssh \u003d MagicMock()"}],"source_content_type":"text/x-python","patch_set":19,"id":"2f0b9222_ca2647b6","line":89,"range":{"start_line":89,"start_character":0,"end_line":89,"end_character":8},"updated":"2023-06-21 14:22:18.000000000","message":"Please, remove this space","commit_id":"f9819fdc47f160e7d00ec6f5288be94c1950a00c"},{"author":{"_account_id":35967,"name":"Lindley Werner Soares Vieira","display_name":"Lindley Werner","email":"lindley.vieira@encora.com","username":"lindleywerner"},"change_message_id":"940c8405d30e6ca0d40cb978f94c603fc4e3f844","unresolved":true,"context_lines":[{"line_number":88,"context_line":"        \"\"\""},{"line_number":89,"context_line":"        "},{"line_number":90,"context_line":"        # Setup"},{"line_number":91,"context_line":"        install_vbox.connect_to_ssh \u003d MagicMock()"},{"line_number":92,"context_line":"        install_vbox._connect_to_ssh \u003d MagicMock()"},{"line_number":93,"context_line":"        install_vbox.get_hostnames \u003d MagicMock(side_effect\u003d[dict([(1,\u0027controller-0\u0027)])])"},{"line_number":94,"context_line":"        install_vbox.check_host_status \u003d MagicMock(return_value\u003d(True, \u0027\u0027))"}],"source_content_type":"text/x-python","patch_set":19,"id":"3f15b598_c40c6b04","line":91,"range":{"start_line":91,"start_character":8,"end_line":91,"end_character":49},"updated":"2023-06-21 14:22:18.000000000","message":"This way to mock the decorator is not working for me","commit_id":"f9819fdc47f160e7d00ec6f5288be94c1950a00c"},{"author":{"_account_id":35967,"name":"Lindley Werner Soares Vieira","display_name":"Lindley Werner","email":"lindley.vieira@encora.com","username":"lindleywerner"},"change_message_id":"940c8405d30e6ca0d40cb978f94c603fc4e3f844","unresolved":true,"context_lines":[{"line_number":90,"context_line":"        # Setup"},{"line_number":91,"context_line":"        install_vbox.connect_to_ssh \u003d MagicMock()"},{"line_number":92,"context_line":"        install_vbox._connect_to_ssh \u003d MagicMock()"},{"line_number":93,"context_line":"        install_vbox.get_hostnames \u003d MagicMock(side_effect\u003d[dict([(1,\u0027controller-0\u0027)])])"},{"line_number":94,"context_line":"        install_vbox.check_host_status \u003d MagicMock(return_value\u003d(True, \u0027\u0027))"},{"line_number":95,"context_line":"        "},{"line_number":96,"context_line":"        # Run"}],"source_content_type":"text/x-python","patch_set":19,"id":"0971503d_0ddef46f","line":93,"range":{"start_line":93,"start_character":67,"end_line":93,"end_character":69},"updated":"2023-06-21 14:22:18.000000000","message":"Pep8 requires a white space after this comma","commit_id":"f9819fdc47f160e7d00ec6f5288be94c1950a00c"},{"author":{"_account_id":35967,"name":"Lindley Werner Soares Vieira","display_name":"Lindley Werner","email":"lindley.vieira@encora.com","username":"lindleywerner"},"change_message_id":"940c8405d30e6ca0d40cb978f94c603fc4e3f844","unresolved":true,"context_lines":[{"line_number":92,"context_line":"        install_vbox._connect_to_ssh \u003d MagicMock()"},{"line_number":93,"context_line":"        install_vbox.get_hostnames \u003d MagicMock(side_effect\u003d[dict([(1,\u0027controller-0\u0027)])])"},{"line_number":94,"context_line":"        install_vbox.check_host_status \u003d MagicMock(return_value\u003d(True, \u0027\u0027))"},{"line_number":95,"context_line":"        "},{"line_number":96,"context_line":"        # Run"},{"line_number":97,"context_line":"        install_vbox.check_hosts_statuses(MOCK_SSH)"},{"line_number":98,"context_line":"        "}],"source_content_type":"text/x-python","patch_set":19,"id":"8ee48f31_c29b6591","line":95,"range":{"start_line":95,"start_character":0,"end_line":95,"end_character":8},"updated":"2023-06-21 14:22:18.000000000","message":"Please, remove this space","commit_id":"f9819fdc47f160e7d00ec6f5288be94c1950a00c"},{"author":{"_account_id":35967,"name":"Lindley Werner Soares Vieira","display_name":"Lindley Werner","email":"lindley.vieira@encora.com","username":"lindleywerner"},"change_message_id":"940c8405d30e6ca0d40cb978f94c603fc4e3f844","unresolved":true,"context_lines":[{"line_number":95,"context_line":"        "},{"line_number":96,"context_line":"        # Run"},{"line_number":97,"context_line":"        install_vbox.check_hosts_statuses(MOCK_SSH)"},{"line_number":98,"context_line":"        "},{"line_number":99,"context_line":"        # Assert"},{"line_number":100,"context_line":"        install_vbox.get_hostnames.assert_called_once()"},{"line_number":101,"context_line":"        install_vbox.check_host_status.assert_called()"}],"source_content_type":"text/x-python","patch_set":19,"id":"5cd45896_28ccf665","line":98,"range":{"start_line":98,"start_character":0,"end_line":98,"end_character":8},"updated":"2023-06-21 14:22:18.000000000","message":"Please, remove this space","commit_id":"f9819fdc47f160e7d00ec6f5288be94c1950a00c"},{"author":{"_account_id":35967,"name":"Lindley Werner Soares Vieira","display_name":"Lindley Werner","email":"lindley.vieira@encora.com","username":"lindleywerner"},"change_message_id":"940c8405d30e6ca0d40cb978f94c603fc4e3f844","unresolved":true,"context_lines":[{"line_number":125,"context_line":"        # Setup"},{"line_number":126,"context_line":"        install_vbox.connect_to_ssh \u003d MagicMock()"},{"line_number":127,"context_line":"        install_vbox._connect_to_ssh \u003d MagicMock()"},{"line_number":128,"context_line":"        install_vbox.get_hostnames \u003d MagicMock(side_effect\u003d[dict([(1,\u0027controller-0\u0027)])])"},{"line_number":129,"context_line":"        install_vbox.check_host_status \u003d MagicMock(return_value\u003d(False, \u0027\u0027))"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"        # Run"}],"source_content_type":"text/x-python","patch_set":19,"id":"8ffd9c40_55ec6f46","line":128,"range":{"start_line":128,"start_character":67,"end_line":128,"end_character":69},"updated":"2023-06-21 14:22:18.000000000","message":"Pep8 requires a white space after this comma","commit_id":"f9819fdc47f160e7d00ec6f5288be94c1950a00c"}],"deployment/virtualbox/pybox/unit_tests.py":[{"author":{"_account_id":35944,"name":"Tomás Nascimento Pimentel Barros","display_name":"Tomás Barros","email":"tomas.barros@encora.com","username":"tomas_barros_encora"},"change_message_id":"bacf2e10417a7c0e809385ec4259491a07157892","unresolved":true,"context_lines":[{"line_number":16,"context_line":"        install_vbox.run_ssh_cmd.return_value \u003d self.expected_host_statuses, \u0027\u0027, \u0027\u0027"},{"line_number":17,"context_line":"        state \u003d install_vbox.check_host_status(None, None, self.expected_statuses)"},{"line_number":18,"context_line":"        install_vbox.run_ssh_cmd.assert_called_once()"},{"line_number":19,"context_line":"        self.assertEqual(state, True), self.UNEXPECTED_STATES_MSG"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"    def test_check_host_status_with_unexpected_format(self):"},{"line_number":22,"context_line":"        install_vbox.run_ssh_cmd \u003d Mock()"}],"source_content_type":"text/x-python","patch_set":16,"id":"d5aee3fc_617f4cf0","line":19,"range":{"start_line":19,"start_character":8,"end_line":19,"end_character":65},"updated":"2023-06-05 22:17:16.000000000","message":"Are the messages displayed when an assert fails \"pythonic\"?","commit_id":"07a01f36b48dc2e1af1b5885a86b8d017e7e0258"},{"author":{"_account_id":35944,"name":"Tomás Nascimento Pimentel Barros","display_name":"Tomás Barros","email":"tomas.barros@encora.com","username":"tomas_barros_encora"},"change_message_id":"43c679609fe39747a0f7fd9deed28c3188479077","unresolved":false,"context_lines":[{"line_number":16,"context_line":"        install_vbox.run_ssh_cmd.return_value \u003d self.expected_host_statuses, \u0027\u0027, \u0027\u0027"},{"line_number":17,"context_line":"        state \u003d install_vbox.check_host_status(None, None, self.expected_statuses)"},{"line_number":18,"context_line":"        install_vbox.run_ssh_cmd.assert_called_once()"},{"line_number":19,"context_line":"        self.assertEqual(state, True), self.UNEXPECTED_STATES_MSG"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"    def test_check_host_status_with_unexpected_format(self):"},{"line_number":22,"context_line":"        install_vbox.run_ssh_cmd \u003d Mock()"}],"source_content_type":"text/x-python","patch_set":16,"id":"29b58ae6_1fc8c48a","line":19,"range":{"start_line":19,"start_character":8,"end_line":19,"end_character":65},"in_reply_to":"5043c29a_8c57110d","updated":"2023-06-06 16:39:06.000000000","message":"Sure, I confused Its behavior with the one from default assert (which doesn\u0027t need parenthesis).","commit_id":"07a01f36b48dc2e1af1b5885a86b8d017e7e0258"},{"author":{"_account_id":35896,"name":"Bruno Drugowick Muniz","display_name":"Bruno","email":"bruno.muniz@encora.com","username":"brunomuniz"},"change_message_id":"c84c5c6c4a48bb2a8107ede0015b262166eab83a","unresolved":true,"context_lines":[{"line_number":16,"context_line":"        install_vbox.run_ssh_cmd.return_value \u003d self.expected_host_statuses, \u0027\u0027, \u0027\u0027"},{"line_number":17,"context_line":"        state \u003d install_vbox.check_host_status(None, None, self.expected_statuses)"},{"line_number":18,"context_line":"        install_vbox.run_ssh_cmd.assert_called_once()"},{"line_number":19,"context_line":"        self.assertEqual(state, True), self.UNEXPECTED_STATES_MSG"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"    def test_check_host_status_with_unexpected_format(self):"},{"line_number":22,"context_line":"        install_vbox.run_ssh_cmd \u003d Mock()"}],"source_content_type":"text/x-python","patch_set":16,"id":"5043c29a_8c57110d","line":19,"range":{"start_line":19,"start_character":8,"end_line":19,"end_character":65},"in_reply_to":"d5aee3fc_617f4cf0","updated":"2023-06-06 15:32:41.000000000","message":"I don\u0027t know about \"pythonic\", but I think these messages are useful.\n\nBut shouldn\u0027t they be inside the parenthesis of the `assertEqual` call?","commit_id":"07a01f36b48dc2e1af1b5885a86b8d017e7e0258"}]}
