)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6488,"name":"Clint Byrum","email":"clint@fewbar.com","username":"clint-fewbar"},"change_message_id":"22a75f8ae96e18ab85f769027d579d85b5d79466","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Julia Kreger \u003cjuliaashleykreger@gmail.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-05-01 17:06:43 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Enhance error message in update_patch"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Updated error messages through the use of try/except blocks in"},{"line_number":10,"context_line":"update_patch in order to help a user identify what the possible"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3acd31a7_74ca1670","line":7,"updated":"2015-05-01 17:34:26.000000000","message":"I think you mean update_machine?","commit_id":"3e1fe0f1c4f21d6b5b39783425e975907bc63003"},{"author":{"_account_id":6488,"name":"Clint Byrum","email":"clint@fewbar.com","username":"clint-fewbar"},"change_message_id":"22a75f8ae96e18ab85f769027d579d85b5d79466","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Enhance error message in update_patch"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Updated error messages through the use of try/except blocks in"},{"line_number":10,"context_line":"update_patch in order to help a user identify what the possible"},{"line_number":11,"context_line":"cause of a failure could be without studying the code."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I04db479ce1b25aadd710cde5d90fe71fa528869b"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3acd31a7_54c95a77","line":10,"updated":"2015-05-01 17:34:26.000000000","message":"Here too?","commit_id":"3e1fe0f1c4f21d6b5b39783425e975907bc63003"}],"shade/__init__.py":[{"author":{"_account_id":6488,"name":"Clint Byrum","email":"clint@fewbar.com","username":"clint-fewbar"},"change_message_id":"22a75f8ae96e18ab85f769027d579d85b5d79466","unresolved":false,"context_lines":[{"line_number":2429,"context_line":"                machine_config[\u0027properties\u0027] \u003d machine[\u0027properties\u0027]"},{"line_number":2430,"context_line":"                new_config[\u0027properties\u0027] \u003d properties"},{"line_number":2431,"context_line":"        except Exception as e:"},{"line_number":2432,"context_line":"            self.log.debug("},{"line_number":2433,"context_line":"                \"Machine update failed - update value preparation failed. \""},{"line_number":2434,"context_line":"                \"Potential API failure or change has been encountered\","},{"line_number":2435,"context_line":"                exc_info\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3acd31a7_34c49e5d","line":2432,"updated":"2015-05-01 17:34:26.000000000","message":"This is better than before, but the errors may not be very user friendly. I see \u0027KeyError\u0027 potential above. It might be good to wrap the extractions above with a function that raises a more friendly error, like this maybe:\n\n    def _get_machine_value(machine, key):\n        if key not in machine:\n            self.log.debug(\"Unexpected machine response missing key %s [%s]\" % (key, machine))\n            raise KeyError(\"required field \u0027%s\u0027 not found in machine response\" % key)\n\nAnyway, just a thought. What is above is totally fine too. :)","commit_id":"3e1fe0f1c4f21d6b5b39783425e975907bc63003"},{"author":{"_account_id":7069,"name":"Joshua Hesketh","email":"josh@nitrotech.org","username":"jhesketh"},"change_message_id":"000e9dcd5312c69650a08d5031d3b580123ac6bc","unresolved":false,"context_lines":[{"line_number":2405,"context_line":"            machine \u003d self.get_machine(name_or_id)"},{"line_number":2406,"context_line":"        except Exception as e:"},{"line_number":2407,"context_line":"            self.log.debug("},{"line_number":2408,"context_line":"                \"Machine update failed. Failed to look up machine by ID\","},{"line_number":2409,"context_line":"                exc_info\u003dTrue)"},{"line_number":2410,"context_line":"            raise OpenStackCloudException("},{"line_number":2411,"context_line":"                \"Machine update failed attempting to look up Machine: %s. \""}],"source_content_type":"text/x-python","patch_set":5,"id":"3acd31a7_c0deaf10","line":2408,"updated":"2015-05-04 07:36:53.000000000","message":"(nit) name or ID really","commit_id":"237e1a4141f985f5693d98540765956be09d8b47"},{"author":{"_account_id":2,"name":"Monty Taylor","email":"mordred@inaugust.com","username":"mordred"},"change_message_id":"f0b23882638af61e67dc225e137e1ac27f531dfb","unresolved":false,"context_lines":[{"line_number":2405,"context_line":"            machine \u003d self.get_machine(name_or_id)"},{"line_number":2406,"context_line":"        except Exception as e:"},{"line_number":2407,"context_line":"            self.log.debug("},{"line_number":2408,"context_line":"                \"Machine update failed. Failed to look up machine by ID\","},{"line_number":2409,"context_line":"                exc_info\u003dTrue)"},{"line_number":2410,"context_line":"            raise OpenStackCloudException("},{"line_number":2411,"context_line":"                \"Machine update failed attempting to look up Machine: %s. \""}],"source_content_type":"text/x-python","patch_set":5,"id":"3acd31a7_929fe6b3","line":2408,"in_reply_to":"3acd31a7_c0deaf10","updated":"2015-05-04 12:18:02.000000000","message":"Done","commit_id":"237e1a4141f985f5693d98540765956be09d8b47"},{"author":{"_account_id":7069,"name":"Joshua Hesketh","email":"josh@nitrotech.org","username":"jhesketh"},"change_message_id":"000e9dcd5312c69650a08d5031d3b580123ac6bc","unresolved":false,"context_lines":[{"line_number":2449,"context_line":"                machine_config[\u0027properties\u0027] \u003d self._get_machine_value("},{"line_number":2450,"context_line":"                    machine, \u0027properties\u0027)"},{"line_number":2451,"context_line":"                new_config[\u0027properties\u0027] \u003d properties"},{"line_number":2452,"context_line":"        except Exception as e:"},{"line_number":2453,"context_line":"            self.log.debug("},{"line_number":2454,"context_line":"                \"Machine update failed - update value preparation failed. \""},{"line_number":2455,"context_line":"                \"Potential API failure or change has been encountered\","}],"source_content_type":"text/x-python","patch_set":5,"id":"3acd31a7_40d3bf04","line":2452,"updated":"2015-05-04 07:36:53.000000000","message":"Probably better to just catch a KeyError here.\n\nIn fact, since you\u0027ve broken the big try into multiple try\u0027s you probably don\u0027t need _get_machine_value. Instead just catch a KeyError here and do the appropriate log and raise for that case.","commit_id":"237e1a4141f985f5693d98540765956be09d8b47"},{"author":{"_account_id":2,"name":"Monty Taylor","email":"mordred@inaugust.com","username":"mordred"},"change_message_id":"f0b23882638af61e67dc225e137e1ac27f531dfb","unresolved":false,"context_lines":[{"line_number":2449,"context_line":"                machine_config[\u0027properties\u0027] \u003d self._get_machine_value("},{"line_number":2450,"context_line":"                    machine, \u0027properties\u0027)"},{"line_number":2451,"context_line":"                new_config[\u0027properties\u0027] \u003d properties"},{"line_number":2452,"context_line":"        except Exception as e:"},{"line_number":2453,"context_line":"            self.log.debug("},{"line_number":2454,"context_line":"                \"Machine update failed - update value preparation failed. \""},{"line_number":2455,"context_line":"                \"Potential API failure or change has been encountered\","}],"source_content_type":"text/x-python","patch_set":5,"id":"3acd31a7_126516e0","line":2452,"in_reply_to":"3acd31a7_40d3bf04","updated":"2015-05-04 12:18:02.000000000","message":"Done","commit_id":"237e1a4141f985f5693d98540765956be09d8b47"},{"author":{"_account_id":10035,"name":"greghaynes","email":"greg@greghaynes.net","username":"greghaynes"},"change_message_id":"75a07ba8c68a2e3120c8bbbe5a1c1c173f79694c","unresolved":false,"context_lines":[{"line_number":2459,"context_line":"                \"potential API issue. Machine: %s Error: %s\""},{"line_number":2460,"context_line":"                % (name_or_id, str(e)))"},{"line_number":2461,"context_line":""},{"line_number":2462,"context_line":"        try:"},{"line_number":2463,"context_line":"            patch \u003d jsonpatch.JsonPatch.from_diff(machine_config, new_config)"},{"line_number":2464,"context_line":"        except Exception as e:"},{"line_number":2465,"context_line":"            self.log.debug("}],"source_content_type":"text/x-python","patch_set":5,"id":"3acd31a7_54cb8872","line":2462,"updated":"2015-05-03 15:30:26.000000000","message":"I know this is kind of a pattern, so not -1ing becuse of it, but Do we really want to wrap *everything* in an except Exception? I kind of get why for clients - they are notoriously bad, but if we are also wrapping our code then any failures we have are going to be extremely painful to debug from logs.","commit_id":"237e1a4141f985f5693d98540765956be09d8b47"},{"author":{"_account_id":2,"name":"Monty Taylor","email":"mordred@inaugust.com","username":"mordred"},"change_message_id":"f0b23882638af61e67dc225e137e1ac27f531dfb","unresolved":false,"context_lines":[{"line_number":2459,"context_line":"                \"potential API issue. Machine: %s Error: %s\""},{"line_number":2460,"context_line":"                % (name_or_id, str(e)))"},{"line_number":2461,"context_line":""},{"line_number":2462,"context_line":"        try:"},{"line_number":2463,"context_line":"            patch \u003d jsonpatch.JsonPatch.from_diff(machine_config, new_config)"},{"line_number":2464,"context_line":"        except Exception as e:"},{"line_number":2465,"context_line":"            self.log.debug("}],"source_content_type":"text/x-python","patch_set":5,"id":"3acd31a7_b29c22c1","line":2462,"in_reply_to":"3acd31a7_54cb8872","updated":"2015-05-04 12:18:02.000000000","message":"Done","commit_id":"237e1a4141f985f5693d98540765956be09d8b47"},{"author":{"_account_id":7069,"name":"Joshua Hesketh","email":"josh@nitrotech.org","username":"jhesketh"},"change_message_id":"000e9dcd5312c69650a08d5031d3b580123ac6bc","unresolved":false,"context_lines":[{"line_number":2459,"context_line":"                \"potential API issue. Machine: %s Error: %s\""},{"line_number":2460,"context_line":"                % (name_or_id, str(e)))"},{"line_number":2461,"context_line":""},{"line_number":2462,"context_line":"        try:"},{"line_number":2463,"context_line":"            patch \u003d jsonpatch.JsonPatch.from_diff(machine_config, new_config)"},{"line_number":2464,"context_line":"        except Exception as e:"},{"line_number":2465,"context_line":"            self.log.debug("}],"source_content_type":"text/x-python","patch_set":5,"id":"3acd31a7_20f56382","line":2462,"in_reply_to":"3acd31a7_54cb8872","updated":"2015-05-04 07:36:53.000000000","message":"I agree, but it\u0027s also no worse than it was.","commit_id":"237e1a4141f985f5693d98540765956be09d8b47"}]}
