)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"2a3cfb9dd074186733e1972a2eb090501936ee64","unresolved":false,"context_lines":[{"line_number":7,"context_line":"encrypt: add --public-key argument"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"the --public-key argument allows the user to provide a local copy of a"},{"line_number":10,"context_line":"project\u0027s public key instead of querying the REST API to fetch it."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: Id37f991f2a16916e1c4338fb336b9b21eb23b498"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"7f9f4cd4_87e059dd","line":10,"updated":"2021-01-29 01:24:39.000000000","message":"FTR most of this change is actually exception handling; probably worth a mention in the commit message.  I think I understand why you did it (so you can avoid emitting tracebacks when you know the argument were just wrong), but I did have to think on it.  ;)","commit_id":"c1c13b9ef64f6d1a43b6fc951f272e5cfca0d5e7"}],"zuulclient/cmd/__init__.py":[{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"49ac4058443951ad4a000c9714c92b095cd95544","unresolved":true,"context_lines":[{"line_number":510,"context_line":"            pubkey_file.write(str.encode(key))"},{"line_number":511,"context_line":"            pubkey_file.close()"},{"line_number":512,"context_line":""},{"line_number":513,"context_line":"        try:"},{"line_number":514,"context_line":"            self.log.debug(\u0027Calling openssl\u0027)"},{"line_number":515,"context_line":"            ciphertext_chunks \u003d encrypt_with_openssl(pubkey_file.name,"},{"line_number":516,"context_line":"                                                     plaintext,"}],"source_content_type":"text/x-python","patch_set":3,"id":"573a8385_e7d76025","line":513,"updated":"2020-12-17 09:04:43.000000000","message":"Is there a reason to pull the pubkey file writing out of the try/except?","commit_id":"b767d8e2847163bffac00fd3b49b70ae84a1fbb5"},{"author":{"_account_id":7186,"name":"Matthieu Huin","email":"mhuin@redhat.com","username":"mhu"},"change_message_id":"efc944ca8559692446c39a20c69ac13f239d43e9","unresolved":true,"context_lines":[{"line_number":510,"context_line":"            pubkey_file.write(str.encode(key))"},{"line_number":511,"context_line":"            pubkey_file.close()"},{"line_number":512,"context_line":""},{"line_number":513,"context_line":"        try:"},{"line_number":514,"context_line":"            self.log.debug(\u0027Calling openssl\u0027)"},{"line_number":515,"context_line":"            ciphertext_chunks \u003d encrypt_with_openssl(pubkey_file.name,"},{"line_number":516,"context_line":"                                                     plaintext,"}],"source_content_type":"text/x-python","patch_set":3,"id":"e84d0605_9908723a","line":513,"in_reply_to":"573a8385_e7d76025","updated":"2020-12-17 11:19:59.000000000","message":"because it got moved to the case where we get the key from the REST API. I\u0027ll add a try/except to cover it","commit_id":"b767d8e2847163bffac00fd3b49b70ae84a1fbb5"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"be0be582aa33d058e14163da32e5d745ccd372f4","unresolved":false,"context_lines":[{"line_number":513,"context_line":"            except Exception as e:"},{"line_number":514,"context_line":"                self.log.exception("},{"line_number":515,"context_line":"                    \u0027Could not write temporary key file: %s\u0027 % e)"},{"line_number":516,"context_line":"                return_code \u003d False"},{"line_number":517,"context_line":"        try:"},{"line_number":518,"context_line":"            self.log.debug(\u0027Calling openssl\u0027)"},{"line_number":519,"context_line":"            ciphertext_chunks \u003d encrypt_with_openssl(pubkey_file.name,"}],"source_content_type":"text/x-python","patch_set":4,"id":"fe3de89d_4b8873ae","line":516,"updated":"2020-12-17 17:14:59.000000000","message":"Oops, I think Tobias\u0027s comment led you astray here.  The purpose of the try/except below is not about the exception handler, it\u0027s about the *finally* handler.  Everything after creating the namedtemporaryfile needs to be in a try/finally that deletes the file at the end.\n\nStrictly speaking, that\u0027s still going to run with this code, but not before this fails a second time because the file is presumably empty.  I think something closer to the original flow would be better.\n\nI think you should remove the try/except you just added for the write, then move the try on line 517 back up to line 502.","commit_id":"0bc882567d77aa26a6b223e3fe89f20b603de442"},{"author":{"_account_id":7186,"name":"Matthieu Huin","email":"mhuin@redhat.com","username":"mhu"},"change_message_id":"e83d10e6f1fda3cad3f4da47a84cba2704da1152","unresolved":false,"context_lines":[{"line_number":513,"context_line":"            except Exception as e:"},{"line_number":514,"context_line":"                self.log.exception("},{"line_number":515,"context_line":"                    \u0027Could not write temporary key file: %s\u0027 % e)"},{"line_number":516,"context_line":"                return_code \u003d False"},{"line_number":517,"context_line":"        try:"},{"line_number":518,"context_line":"            self.log.debug(\u0027Calling openssl\u0027)"},{"line_number":519,"context_line":"            ciphertext_chunks \u003d encrypt_with_openssl(pubkey_file.name,"}],"source_content_type":"text/x-python","patch_set":4,"id":"feb159aa_0d578af8","line":516,"in_reply_to":"fe3de89d_4b8873ae","updated":"2020-12-17 17:39:43.000000000","message":"ah, makes sense. There\u0027s room for improvements in exception catching and handling overall, hopefully in a later patch.","commit_id":"0bc882567d77aa26a6b223e3fe89f20b603de442"},{"author":{"_account_id":16068,"name":"Tobias Henkel","email":"tobias.henkel@bmw.de","username":"tobias.henkel"},"change_message_id":"d43ed98f5331e059dcca9b6472cf8d5e50a83cfd","unresolved":true,"context_lines":[{"line_number":541,"context_line":"            else:"},{"line_number":542,"context_line":"                print(output)"},{"line_number":543,"context_line":"            return_code \u003d True"},{"line_number":544,"context_line":"        except ArgumentException as e:"},{"line_number":545,"context_line":"            # re-raise, caught later"},{"line_number":546,"context_line":"            raise e"},{"line_number":547,"context_line":"        except Exception as e:"}],"source_content_type":"text/x-python","patch_set":5,"id":"bb6ef764_f4d7a537","line":544,"updated":"2020-12-17 17:40:46.000000000","message":"Is this necessary? It looks to me that the ArgumentException is thrown outside of this try block.","commit_id":"f5967b2213f53bf575f544c95404c31a846f5ea9"},{"author":{"_account_id":7186,"name":"Matthieu Huin","email":"mhuin@redhat.com","username":"mhu"},"change_message_id":"c3939d504e8e56c1f1de25477a580019a5d3b9fa","unresolved":false,"context_lines":[{"line_number":541,"context_line":"            else:"},{"line_number":542,"context_line":"                print(output)"},{"line_number":543,"context_line":"            return_code \u003d True"},{"line_number":544,"context_line":"        except ArgumentException as e:"},{"line_number":545,"context_line":"            # re-raise, caught later"},{"line_number":546,"context_line":"            raise e"},{"line_number":547,"context_line":"        except Exception as e:"}],"source_content_type":"text/x-python","patch_set":5,"id":"ac32c731_b6f660d2","line":544,"in_reply_to":"bb6ef764_f4d7a537","updated":"2021-01-19 16:37:21.000000000","message":"it can potentially be raised by _check_tenant_scope l.514","commit_id":"f5967b2213f53bf575f544c95404c31a846f5ea9"}]}
