)]}'
{"ceph-client/templates/bin/_helm-tests.sh.tpl":[{"author":{"_account_id":29974,"name":"Stephen Taylor","email":"stephen.taylor.1@att.com","username":"st053q"},"change_message_id":"97566ad4fadaa0e5f757606192313c513fb65daa","unresolved":false,"context_lines":[{"line_number":274,"context_line":"}"},{"line_number":275,"context_line":""},{"line_number":276,"context_line":"function check_ceph_osd_crush_weight(){"},{"line_number":277,"context_line":"  OSDS_WITH_ZERO_WEIGHT\u003d(`ceph --cluster ${CLUSTER} ceph osd tree | grep osd | awk \u0027$3 \u003d\u003d \"0\" {print $1}\u0027)"},{"line_number":278,"context_line":"  if [[ ${#OSDS_WITH_ZERO_WEIGHT[*]} -eq 0 ]]; then"},{"line_number":279,"context_line":"    echo \"All osds from namespace have correct crush weight!\""},{"line_number":280,"context_line":"  else"}],"source_content_type":"text/x-smarty","patch_set":1,"id":"9f560f44_c37139e1","line":277,"range":{"start_line":277,"start_character":57,"end_line":277,"end_character":65},"updated":"2020-08-11 22:01:55.000000000","message":"It would be better to use \u0027osd df\u0027 instead of \u0027osd tree\u0027 here because it\u0027s possible that a hostname could have the string \u0027osd\u0027 in it and cause problems with this command.","commit_id":"ed8e69c19081cc7eb791589cd3382cb25fd23630"},{"author":{"_account_id":29974,"name":"Stephen Taylor","email":"stephen.taylor.1@att.com","username":"st053q"},"change_message_id":"97566ad4fadaa0e5f757606192313c513fb65daa","unresolved":false,"context_lines":[{"line_number":274,"context_line":"}"},{"line_number":275,"context_line":""},{"line_number":276,"context_line":"function check_ceph_osd_crush_weight(){"},{"line_number":277,"context_line":"  OSDS_WITH_ZERO_WEIGHT\u003d(`ceph --cluster ${CLUSTER} ceph osd tree | grep osd | awk \u0027$3 \u003d\u003d \"0\" {print $1}\u0027)"},{"line_number":278,"context_line":"  if [[ ${#OSDS_WITH_ZERO_WEIGHT[*]} -eq 0 ]]; then"},{"line_number":279,"context_line":"    echo \"All osds from namespace have correct crush weight!\""},{"line_number":280,"context_line":"  else"}],"source_content_type":"text/x-smarty","patch_set":1,"id":"9f560f44_a36b65ef","line":277,"range":{"start_line":277,"start_character":52,"end_line":277,"end_character":56},"updated":"2020-08-11 22:01:55.000000000","message":"The \u0027ceph\u0027 command appears twice here.","commit_id":"ed8e69c19081cc7eb791589cd3382cb25fd23630"},{"author":{"_account_id":29974,"name":"Stephen Taylor","email":"stephen.taylor.1@att.com","username":"st053q"},"change_message_id":"97566ad4fadaa0e5f757606192313c513fb65daa","unresolved":false,"context_lines":[{"line_number":276,"context_line":"function check_ceph_osd_crush_weight(){"},{"line_number":277,"context_line":"  OSDS_WITH_ZERO_WEIGHT\u003d(`ceph --cluster ${CLUSTER} ceph osd tree | grep osd | awk \u0027$3 \u003d\u003d \"0\" {print $1}\u0027)"},{"line_number":278,"context_line":"  if [[ ${#OSDS_WITH_ZERO_WEIGHT[*]} -eq 0 ]]; then"},{"line_number":279,"context_line":"    echo \"All osds from namespace have correct crush weight!\""},{"line_number":280,"context_line":"  else"},{"line_number":281,"context_line":"    echo \"osd(s) from namespace has(have) zero crush weight\""},{"line_number":282,"context_line":"  fi"}],"source_content_type":"text/x-smarty","patch_set":1,"id":"9f560f44_434fe991","line":279,"range":{"start_line":279,"start_character":39,"end_line":279,"end_character":46},"updated":"2020-08-11 22:01:55.000000000","message":"nit: non-zero doesn\u0027t necessarily mean correct","commit_id":"ed8e69c19081cc7eb791589cd3382cb25fd23630"},{"author":{"_account_id":8898,"name":"Chris Wedgwood","email":"cw@f00f.org","username":"anticw"},"change_message_id":"75be3644d0a728b462c2e6f662795c438d50cd89","unresolved":false,"context_lines":[{"line_number":274,"context_line":"}"},{"line_number":275,"context_line":""},{"line_number":276,"context_line":"function check_ceph_osd_crush_weight(){"},{"line_number":277,"context_line":"  OSDS_WITH_ZERO_WEIGHT\u003d(`ceph --cluster ${CLUSTER} osd df  | tail -n +2|head -n -2 | awk \u0027$3 \u003d\u003d \"0\" {print $1}\u0027`)"},{"line_number":278,"context_line":"  if [[ ${#OSDS_WITH_ZERO_WEIGHT[*]} -eq 0 ]]; then"},{"line_number":279,"context_line":"    echo \"All osds from namespace have crush weight!\""},{"line_number":280,"context_line":"  else"}],"source_content_type":"text/x-smarty","patch_set":4,"id":"9f560f44_f9c4ea61","line":277,"range":{"start_line":277,"start_character":25,"end_line":277,"end_character":26},"updated":"2020-08-12 01:54:22.000000000","message":"\"$(...)\" cleaner?","commit_id":"9e002e1975ec7c8e60193feeadb22da052bfeff1"},{"author":{"_account_id":8898,"name":"Chris Wedgwood","email":"cw@f00f.org","username":"anticw"},"change_message_id":"75be3644d0a728b462c2e6f662795c438d50cd89","unresolved":false,"context_lines":[{"line_number":274,"context_line":"}"},{"line_number":275,"context_line":""},{"line_number":276,"context_line":"function check_ceph_osd_crush_weight(){"},{"line_number":277,"context_line":"  OSDS_WITH_ZERO_WEIGHT\u003d(`ceph --cluster ${CLUSTER} osd df  | tail -n +2|head -n -2 | awk \u0027$3 \u003d\u003d \"0\" {print $1}\u0027`)"},{"line_number":278,"context_line":"  if [[ ${#OSDS_WITH_ZERO_WEIGHT[*]} -eq 0 ]]; then"},{"line_number":279,"context_line":"    echo \"All osds from namespace have crush weight!\""},{"line_number":280,"context_line":"  else"}],"source_content_type":"text/x-smarty","patch_set":4,"id":"9f560f44_599fd664","line":277,"range":{"start_line":277,"start_character":60,"end_line":277,"end_character":111},"updated":"2020-08-12 01:54:22.000000000","message":"this whole line/pipeline feels icky/fragile\n\ncan you not use --format json | jq ...\n\nand do something robust?","commit_id":"9e002e1975ec7c8e60193feeadb22da052bfeff1"},{"author":{"_account_id":29974,"name":"Stephen Taylor","email":"stephen.taylor.1@att.com","username":"st053q"},"change_message_id":"ef6949c9e61f5521593c2f64e6c390e65e628197","unresolved":false,"context_lines":[{"line_number":274,"context_line":"}"},{"line_number":275,"context_line":""},{"line_number":276,"context_line":"function check_ceph_osd_crush_weight(){"},{"line_number":277,"context_line":"  OSDS_WITH_ZERO_WEIGHT\u003d(`ceph --cluster ${CLUSTER} osd df  | tail -n +2|head -n -2 | awk \u0027$3 \u003d\u003d \"0\" {print $1}\u0027`)"},{"line_number":278,"context_line":"  if [[ ${#OSDS_WITH_ZERO_WEIGHT[*]} -eq 0 ]]; then"},{"line_number":279,"context_line":"    echo \"All osds from namespace have crush weight!\""},{"line_number":280,"context_line":"  else"}],"source_content_type":"text/x-smarty","patch_set":4,"id":"9f560f44_ef1ff76d","line":277,"range":{"start_line":277,"start_character":60,"end_line":277,"end_character":111},"in_reply_to":"9f560f44_599fd664","updated":"2020-08-12 14:12:16.000000000","message":"The problem with using jq here is that the json schema has changed in different ceph versions, so an additional query has to be made to determine the ceph version and then version-specific jq queries have to exist. This hassle can be avoided by using --format json-pretty and using grep to parse the output though. No head nor tail required and a single query works for every ceph version. If done correctly this can also be very robust.","commit_id":"9e002e1975ec7c8e60193feeadb22da052bfeff1"},{"author":{"_account_id":18511,"name":"Brian Wickersham","email":"bkw86@bellsouth.net","username":"bw6938"},"change_message_id":"426feaf6ebf0c7c4f6328647c9b5e2f39723e477","unresolved":false,"context_lines":[{"line_number":276,"context_line":"function check_ceph_osd_crush_weight(){"},{"line_number":277,"context_line":"  OSDS_WITH_ZERO_WEIGHT\u003d(`ceph --cluster ${CLUSTER} osd df -f json-pretty | awk -F\"[, ]*\" \u0027/\"crush_weight\":/{if ($3 \u003d\u003d 0) print $3}\u0027`)"},{"line_number":278,"context_line":"  if [[ ${#OSDS_WITH_ZERO_WEIGHT[*]} -eq 0 ]]; then"},{"line_number":279,"context_line":"    echo \"All osds from namespace have crush weight!\""},{"line_number":280,"context_line":"  else"},{"line_number":281,"context_line":"    echo \"Osd(s) from namespace has(have) zero crush weight\""},{"line_number":282,"context_line":"    exit 1"}],"source_content_type":"text/x-smarty","patch_set":6,"id":"9f560f44_c28d9832","line":279,"range":{"start_line":279,"start_character":14,"end_line":279,"end_character":18},"updated":"2020-08-13 14:36:03.000000000","message":"Nit - but else where in this file we print OSDs instead of osds or Osd","commit_id":"2f288465c223d57fe65c273b925b0f18dfe0573b"},{"author":{"_account_id":28372,"name":"chinasubbareddy mallavarapu","email":"cr3938@att.com","username":"chinasubbareddy"},"change_message_id":"3262abe9ef63ee5f2591bac437e245fcb8f373e1","unresolved":false,"context_lines":[{"line_number":276,"context_line":"function check_ceph_osd_crush_weight(){"},{"line_number":277,"context_line":"  OSDS_WITH_ZERO_WEIGHT\u003d(`ceph --cluster ${CLUSTER} osd df -f json-pretty | awk -F\"[, ]*\" \u0027/\"crush_weight\":/{if ($3 \u003d\u003d 0) print $3}\u0027`)"},{"line_number":278,"context_line":"  if [[ ${#OSDS_WITH_ZERO_WEIGHT[*]} -eq 0 ]]; then"},{"line_number":279,"context_line":"    echo \"All osds from namespace have crush weight!\""},{"line_number":280,"context_line":"  else"},{"line_number":281,"context_line":"    echo \"Osd(s) from namespace has(have) zero crush weight\""},{"line_number":282,"context_line":"    exit 1"}],"source_content_type":"text/x-smarty","patch_set":6,"id":"9f560f44_62cf6c57","line":279,"range":{"start_line":279,"start_character":14,"end_line":279,"end_character":18},"in_reply_to":"9f560f44_c28d9832","updated":"2020-08-13 14:39:57.000000000","message":"Done","commit_id":"2f288465c223d57fe65c273b925b0f18dfe0573b"},{"author":{"_account_id":18511,"name":"Brian Wickersham","email":"bkw86@bellsouth.net","username":"bw6938"},"change_message_id":"426feaf6ebf0c7c4f6328647c9b5e2f39723e477","unresolved":false,"context_lines":[{"line_number":278,"context_line":"  if [[ ${#OSDS_WITH_ZERO_WEIGHT[*]} -eq 0 ]]; then"},{"line_number":279,"context_line":"    echo \"All osds from namespace have crush weight!\""},{"line_number":280,"context_line":"  else"},{"line_number":281,"context_line":"    echo \"Osd(s) from namespace has(have) zero crush weight\""},{"line_number":282,"context_line":"    exit 1"},{"line_number":283,"context_line":"  fi"},{"line_number":284,"context_line":"}"}],"source_content_type":"text/x-smarty","patch_set":6,"id":"9f560f44_0288301d","line":281,"range":{"start_line":281,"start_character":10,"end_line":281,"end_character":13},"updated":"2020-08-13 14:36:03.000000000","message":"Nit - but else where in this file we print OSDs instead of osds or Osd","commit_id":"2f288465c223d57fe65c273b925b0f18dfe0573b"},{"author":{"_account_id":28372,"name":"chinasubbareddy mallavarapu","email":"cr3938@att.com","username":"chinasubbareddy"},"change_message_id":"3262abe9ef63ee5f2591bac437e245fcb8f373e1","unresolved":false,"context_lines":[{"line_number":278,"context_line":"  if [[ ${#OSDS_WITH_ZERO_WEIGHT[*]} -eq 0 ]]; then"},{"line_number":279,"context_line":"    echo \"All osds from namespace have crush weight!\""},{"line_number":280,"context_line":"  else"},{"line_number":281,"context_line":"    echo \"Osd(s) from namespace has(have) zero crush weight\""},{"line_number":282,"context_line":"    exit 1"},{"line_number":283,"context_line":"  fi"},{"line_number":284,"context_line":"}"}],"source_content_type":"text/x-smarty","patch_set":6,"id":"9f560f44_42cce860","line":281,"range":{"start_line":281,"start_character":10,"end_line":281,"end_character":13},"in_reply_to":"9f560f44_0288301d","updated":"2020-08-13 14:39:57.000000000","message":"Done","commit_id":"2f288465c223d57fe65c273b925b0f18dfe0573b"}]}
