)]}'
{"rabbitmq/templates/bin/_rabbitmq-test.sh.tpl":[{"author":{"_account_id":8749,"name":"Evgeniy L","email":"eli@mirantis.com","username":"evgeniyl"},"change_message_id":"4e19d75a1312d7b5464df2a62eac41da787be012","unresolved":false,"context_lines":[{"line_number":60,"context_line":"import json, sys;"},{"line_number":61,"context_line":"obj\u003djson.load(sys.stdin);"},{"line_number":62,"context_line":"for num, node in enumerate(obj):"},{"line_number":63,"context_line":"  print(node.get(\u0027partitions\u0027, \u0027partition key not found\u0027));\""},{"line_number":64,"context_line":"  )"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"  for PARTITION in ${PARTITIONS}; do"}],"source_content_type":"text/x-smarty","patch_set":3,"id":"dfbec78f_c02d64fe","line":63,"range":{"start_line":63,"start_character":12,"end_line":63,"end_character":17},"updated":"2019-05-16 16:43:46.000000000","message":"I\u0027m curious, is there some specific use-case that requires to handle a node without the `partitions` key? In case this happens it would just fail with self-explanatory KeyError exception, and the script would exit with non zero code (because of \"set -e\").","commit_id":"a77ce9ebdf530239b44a0f0417df3e81d4eb68fe"},{"author":{"_account_id":17068,"name":"Jean-Philippe Evrard","email":"openstack@a.spamming.party","username":"evrardjp"},"change_message_id":"688c6237156a9bd495374698bf0f45edc8fb9c81","unresolved":false,"context_lines":[{"line_number":60,"context_line":"import json, sys;"},{"line_number":61,"context_line":"obj\u003djson.load(sys.stdin);"},{"line_number":62,"context_line":"for num, node in enumerate(obj):"},{"line_number":63,"context_line":"  print(node.get(\u0027partitions\u0027, \u0027partition key not found\u0027));\""},{"line_number":64,"context_line":"  )"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"  for PARTITION in ${PARTITIONS}; do"}],"source_content_type":"text/x-smarty","patch_set":3,"id":"bfb3d3c7_a5493961","line":63,"range":{"start_line":63,"start_character":12,"end_line":63,"end_character":17},"in_reply_to":"dfbec78f_436c1ecd","updated":"2019-05-17 08:08:36.000000000","message":"Indeed. See my comment above.","commit_id":"a77ce9ebdf530239b44a0f0417df3e81d4eb68fe"},{"author":{"_account_id":12281,"name":"Itxaka","email":"igarcia@suse.com","username":"itxaka"},"change_message_id":"a134a02ebad1002154c510e837271130570a8b9d","unresolved":false,"context_lines":[{"line_number":60,"context_line":"import json, sys;"},{"line_number":61,"context_line":"obj\u003djson.load(sys.stdin);"},{"line_number":62,"context_line":"for num, node in enumerate(obj):"},{"line_number":63,"context_line":"  print(node.get(\u0027partitions\u0027, \u0027partition key not found\u0027));\""},{"line_number":64,"context_line":"  )"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"  for PARTITION in ${PARTITIONS}; do"}],"source_content_type":"text/x-smarty","patch_set":3,"id":"dfbec78f_436c1ecd","line":63,"range":{"start_line":63,"start_character":12,"end_line":63,"end_character":17},"in_reply_to":"dfbec78f_c02d64fe","updated":"2019-05-16 17:12:21.000000000","message":"Agreed, this seems to be changing the expected outcome of the code if there is no partitions key.","commit_id":"a77ce9ebdf530239b44a0f0417df3e81d4eb68fe"},{"author":{"_account_id":17068,"name":"Jean-Philippe Evrard","email":"openstack@a.spamming.party","username":"evrardjp"},"change_message_id":"688c6237156a9bd495374698bf0f45edc8fb9c81","unresolved":false,"context_lines":[{"line_number":60,"context_line":"import json, sys;"},{"line_number":61,"context_line":"obj\u003djson.load(sys.stdin);"},{"line_number":62,"context_line":"for num, node in enumerate(obj):"},{"line_number":63,"context_line":"  print(node.get(\u0027partitions\u0027, \u0027partition key not found\u0027));\""},{"line_number":64,"context_line":"  )"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"  for PARTITION in ${PARTITIONS}; do"}],"source_content_type":"text/x-smarty","patch_set":3,"id":"bfb3d3c7_455b9d2d","line":63,"range":{"start_line":63,"start_character":12,"end_line":63,"end_character":17},"in_reply_to":"dfbec78f_c02d64fe","updated":"2019-05-17 08:08:36.000000000","message":"Yes, I just got an issue where partition key was not set, and there was still a \"Cluster partition found\" because node wasn\u0027t empty. From that, it\u0027s almost impossible to debug, because there is no information, no stacktrace, not even \"Cluster partition found\"\n\nFor an operator, only logging the exception (\"KeyError\") is not very explicit. Because we have error handling later, I thought I could use that instead.\n\nBut it would be better indeed to deal with everything directly from that python code, and throw exceptions with the appropriate message directly. It would allow to drop the object better into the context too.\n\nI am ok to refine this. The most important for me was to ensure readiness, should the official rabbitmq image have python3 installed by default at some point.","commit_id":"a77ce9ebdf530239b44a0f0417df3e81d4eb68fe"},{"author":{"_account_id":12281,"name":"Itxaka","email":"igarcia@suse.com","username":"itxaka"},"change_message_id":"3415c0f8031ee4f2b432871ccd04739556b0502f","unresolved":false,"context_lines":[{"line_number":60,"context_line":"import json, sys;"},{"line_number":61,"context_line":"obj\u003djson.load(sys.stdin);"},{"line_number":62,"context_line":"for num, node in enumerate(obj):"},{"line_number":63,"context_line":"  print(node.get(\u0027partitions\u0027, \u0027partition key not found\u0027));\""},{"line_number":64,"context_line":"  )"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"  for PARTITION in ${PARTITIONS}; do"}],"source_content_type":"text/x-smarty","patch_set":4,"id":"bfb3d3c7_4545dd16","line":63,"updated":"2019-05-17 08:21:38.000000000","message":"so again, this would fail before on the old way so the rabbitmq-test container would fail, while it currently does skip the failure, thus making this test useless.\n\nEither we raise an error here as to maintain the existing functionality or we just remove this partitions test.","commit_id":"847940c2794addbab5d04924a297547abaf7ddf3"},{"author":{"_account_id":17068,"name":"Jean-Philippe Evrard","email":"openstack@a.spamming.party","username":"evrardjp"},"change_message_id":"f84c11148cc19e3c2e7239ce073aaacf05b90ddc","unresolved":false,"context_lines":[{"line_number":60,"context_line":"import json, sys;"},{"line_number":61,"context_line":"obj\u003djson.load(sys.stdin);"},{"line_number":62,"context_line":"for num, node in enumerate(obj):"},{"line_number":63,"context_line":"  print(node.get(\u0027partitions\u0027, \u0027partition key not found\u0027));\""},{"line_number":64,"context_line":"  )"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"  for PARTITION in ${PARTITIONS}; do"}],"source_content_type":"text/x-smarty","patch_set":4,"id":"bfb3d3c7_c5178ded","line":63,"in_reply_to":"bfb3d3c7_4545dd16","updated":"2019-05-17 08:28:56.000000000","message":"Please read my other comment. I am refactoring this.\n\nOn top of that, this would still raise an error, because the output is different than []. So it maintains the existing functionality. However it\u0027s already an improvement, as it is clearer for the deployer, because it would explain that a \u0027partition is found\u0027 but the \u0027partition key is not found\u0027.","commit_id":"847940c2794addbab5d04924a297547abaf7ddf3"},{"author":{"_account_id":12281,"name":"Itxaka","email":"igarcia@suse.com","username":"itxaka"},"change_message_id":"65f0e3bb874df4810de50e4a5e3525c3c710efe7","unresolved":false,"context_lines":[{"line_number":60,"context_line":"import json, sys;"},{"line_number":61,"context_line":"obj\u003djson.load(sys.stdin);"},{"line_number":62,"context_line":"for num, node in enumerate(obj):"},{"line_number":63,"context_line":"  print(node.get(\u0027partitions\u0027, \u0027partition key not found\u0027));\""},{"line_number":64,"context_line":"  )"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"  for PARTITION in ${PARTITIONS}; do"}],"source_content_type":"text/x-smarty","patch_set":4,"id":"bfb3d3c7_c51d4dbe","line":63,"in_reply_to":"bfb3d3c7_c5178ded","updated":"2019-05-17 08:50:28.000000000","message":"maybe Im missing it but how would this raise an error?\n\n\u003e\u003e\u003e a \u003d {}\n\u003e\u003e\u003e print a[\u0027b\u0027]\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\nKeyError: \u0027b\u0027\n\u003e\u003e\u003e print a.get(\u0027b\u0027, \u0027no error\u0027)\nno error\n\n\nBefore this, if the api response from rabbit did not contain the partitions key it would raise a KeyError, but now it will just return a string. Thus making the output of this always return 0 as exit code, while raising the KeyError would make this a 1 exit code, which would terminate the script right there.\n\n\nI might be missing something here tbh or maybe your plan to refactor it and I dont see that yet so my response is based only on the current code :)","commit_id":"847940c2794addbab5d04924a297547abaf7ddf3"},{"author":{"_account_id":17068,"name":"Jean-Philippe Evrard","email":"openstack@a.spamming.party","username":"evrardjp"},"change_message_id":"b436a091c7437e7e8c2403075c77bd5975bab7ea","unresolved":false,"context_lines":[{"line_number":60,"context_line":"import json, sys;"},{"line_number":61,"context_line":"obj\u003djson.load(sys.stdin);"},{"line_number":62,"context_line":"for num, node in enumerate(obj):"},{"line_number":63,"context_line":"  print(node.get(\u0027partitions\u0027, \u0027partition key not found\u0027));\""},{"line_number":64,"context_line":"  )"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"  for PARTITION in ${PARTITIONS}; do"}],"source_content_type":"text/x-smarty","patch_set":4,"id":"bfb3d3c7_c5722d12","line":63,"in_reply_to":"bfb3d3c7_c51d4dbe","updated":"2019-05-17 08:52:45.000000000","message":"Because of the L69. The L66-70 loops over the stdout of the python script, and if the expected output is different than the python script output, it would exit 1.","commit_id":"847940c2794addbab5d04924a297547abaf7ddf3"},{"author":{"_account_id":8749,"name":"Evgeniy L","email":"eli@mirantis.com","username":"evgeniyl"},"change_message_id":"87073ebd4487b8bfdb690e7d38bfcd31a4b0390d","unresolved":false,"context_lines":[{"line_number":65,"context_line":"    if partition:"},{"line_number":66,"context_line":"      raise Exception(\u0027cluster partition found: %s\u0027 % partition)"},{"line_number":67,"context_line":"  except KeyError:"},{"line_number":68,"context_line":"    print(\u0027partition key not found for node %s\u0027 % node)"},{"line_number":69,"context_line":"    sys.exit(1)"},{"line_number":70,"context_line":"  except:"},{"line_number":71,"context_line":"    traceback.print_exc()"}],"source_content_type":"text/x-smarty","patch_set":13,"id":"bfb3d3c7_aae9cb1a","line":68,"range":{"start_line":68,"start_character":10,"end_line":68,"end_character":11},"updated":"2019-05-21 17:24:49.000000000","message":"I think it would be useful to prefix this with \"Error: \" to let the reader know, that this is not expected.","commit_id":"3c1b3bd054c4d937e2aebfc09e8a09e256a4bdfb"},{"author":{"_account_id":8749,"name":"Evgeniy L","email":"eli@mirantis.com","username":"evgeniyl"},"change_message_id":"87073ebd4487b8bfdb690e7d38bfcd31a4b0390d","unresolved":false,"context_lines":[{"line_number":67,"context_line":"  except KeyError:"},{"line_number":68,"context_line":"    print(\u0027partition key not found for node %s\u0027 % node)"},{"line_number":69,"context_line":"    sys.exit(1)"},{"line_number":70,"context_line":"  except:"},{"line_number":71,"context_line":"    traceback.print_exc()"},{"line_number":72,"context_line":"    sys.exit(1)"},{"line_number":73,"context_line":"print(\u0027No cluster partitions found\u0027)"},{"line_number":74,"context_line":"  \""},{"line_number":75,"context_line":"}"}],"source_content_type":"text/x-smarty","patch_set":13,"id":"bfb3d3c7_4a936fa4","line":72,"range":{"start_line":70,"start_character":2,"end_line":72,"end_character":15},"updated":"2019-05-21 17:24:49.000000000","message":"If this is removed, it should still print the trace and exit with 1.\n\n    $ python -c \u0027raise Exception(\"blha\")\u0027\n    Traceback (most recent call last):\n      File \"\u003cstring\u003e\", line 1, in \u003cmodule\u003e\n    Exception: blha\n    $ echo $?\n    1","commit_id":"3c1b3bd054c4d937e2aebfc09e8a09e256a4bdfb"}]}
