)]}'
{"tools/xenserver/rotate_xen_guest_logs.sh":[{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"511d9c3dab1b89769c69c947fecbbc9d94c519f0","unresolved":false,"context_lines":[{"line_number":28,"context_line":"# Grab the list of logs now to prevent a race where the domain is"},{"line_number":29,"context_line":"# started after we get the valid last_dom_ids, but before the logs are"},{"line_number":30,"context_line":"# deleted.  Add spaces to ensure we can do containment tests below"},{"line_number":31,"context_line":"current_logs\u003d$(find $log_dir -type f)"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"# Ensure the last_dom_id is set + updated for all running VMs"},{"line_number":34,"context_line":"for vm in $(xe vm-list power-state\u003drunning --minimal | tr \u0027,\u0027 \u0027 \u0027); do"}],"source_content_type":"text/x-sh","patch_set":2,"id":"7a740942_37edfaef","line":31,"updated":"2015-12-09 12:10:37.000000000","message":"nit: \"\" around $log_dir","commit_id":"bd04c73c542c10c02bb4543ee64d29da214751d2"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"b9dfb849208d0815ad44dddccaa617dd39edc4ef","unresolved":false,"context_lines":[{"line_number":28,"context_line":"# Grab the list of logs now to prevent a race where the domain is"},{"line_number":29,"context_line":"# started after we get the valid last_dom_ids, but before the logs are"},{"line_number":30,"context_line":"# deleted.  Add spaces to ensure we can do containment tests below"},{"line_number":31,"context_line":"current_logs\u003d$(find $log_dir -type f)"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"# Ensure the last_dom_id is set + updated for all running VMs"},{"line_number":34,"context_line":"for vm in $(xe vm-list power-state\u003drunning --minimal | tr \u0027,\u0027 \u0027 \u0027); do"}],"source_content_type":"text/x-sh","patch_set":2,"id":"7a740942_e2b80eeb","line":31,"in_reply_to":"7a740942_37edfaef","updated":"2015-12-09 13:52:33.000000000","message":"since log_dir is defined above, this isn\u0027t needed","commit_id":"bd04c73c542c10c02bb4543ee64d29da214751d2"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"089f7dd7e98d2325183bacdb5b666647bd4e6ea0","unresolved":false,"context_lines":[{"line_number":28,"context_line":"# Grab the list of logs now to prevent a race where the domain is"},{"line_number":29,"context_line":"# started after we get the valid last_dom_ids, but before the logs are"},{"line_number":30,"context_line":"# deleted.  Add spaces to ensure we can do containment tests below"},{"line_number":31,"context_line":"current_logs\u003d$(find $log_dir -type f)"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"# Ensure the last_dom_id is set + updated for all running VMs"},{"line_number":34,"context_line":"for vm in $(xe vm-list power-state\u003drunning --minimal | tr \u0027,\u0027 \u0027 \u0027); do"}],"source_content_type":"text/x-sh","patch_set":2,"id":"7a740942_31486d2d","line":31,"in_reply_to":"7a740942_e2b80eeb","updated":"2015-12-10 10:28:15.000000000","message":"It\u0027s unsafe to rely on this, someone could easily change log_dir to contain a space without realising the rest of the script has been lazily quoted.\n\nI marked it as a nit because I had seen log_dir didn\u0027t contain spaces but that doesn\u0027t make it harmless :P","commit_id":"bd04c73c542c10c02bb4543ee64d29da214751d2"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"511d9c3dab1b89769c69c947fecbbc9d94c519f0","unresolved":false,"context_lines":[{"line_number":40,"context_line":"echo \"Valid dom IDs: $valid_last_dom_ids\" | /usr/bin/logger -t $syslog_tag"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"# Remove console files that do not correspond to valid last_dom_id\u0027s"},{"line_number":43,"context_line":"allowed_consoles\u003d\".*console.\\(${valid_last_dom_ids// /\\\\|}\\)$\""},{"line_number":44,"context_line":"delete_logs\u003d`find $log_dir -type f -not -regex $allowed_consoles`"},{"line_number":45,"context_line":"for log in $delete_logs; do"},{"line_number":46,"context_line":"    if echo $current_logs | grep -q -w $log; then"}],"source_content_type":"text/x-sh","patch_set":2,"id":"7a740942_71f5d2c9","line":43,"updated":"2015-12-09 12:10:37.000000000","message":"s/\"/\u0027/g to protect the \\s","commit_id":"bd04c73c542c10c02bb4543ee64d29da214751d2"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"a8e796d82734e1121d21b554b986b9fe97f47a9c","unresolved":false,"context_lines":[{"line_number":40,"context_line":"echo \"Valid dom IDs: $valid_last_dom_ids\" | /usr/bin/logger -t $syslog_tag"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"# Remove console files that do not correspond to valid last_dom_id\u0027s"},{"line_number":43,"context_line":"allowed_consoles\u003d\".*console.\\(${valid_last_dom_ids// /\\\\|}\\)$\""},{"line_number":44,"context_line":"delete_logs\u003d`find $log_dir -type f -not -regex $allowed_consoles`"},{"line_number":45,"context_line":"for log in $delete_logs; do"},{"line_number":46,"context_line":"    if echo $current_logs | grep -q -w $log; then"}],"source_content_type":"text/x-sh","patch_set":2,"id":"3a7e1126_e203f9b6","line":43,"in_reply_to":"7a740942_71f5d2c9","updated":"2015-12-17 13:15:13.000000000","message":"Can\u0027t do this as valid_last_dom_ids wouldn\u0027t be evaluated.","commit_id":"bd04c73c542c10c02bb4543ee64d29da214751d2"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"511d9c3dab1b89769c69c947fecbbc9d94c519f0","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"# Remove console files that do not correspond to valid last_dom_id\u0027s"},{"line_number":43,"context_line":"allowed_consoles\u003d\".*console.\\(${valid_last_dom_ids// /\\\\|}\\)$\""},{"line_number":44,"context_line":"delete_logs\u003d`find $log_dir -type f -not -regex $allowed_consoles`"},{"line_number":45,"context_line":"for log in $delete_logs; do"},{"line_number":46,"context_line":"    if echo $current_logs | grep -q -w $log; then"},{"line_number":47,"context_line":"        echo \"Deleting : $log\" | /usr/bin/logger -t $syslog_tag"}],"source_content_type":"text/x-sh","patch_set":2,"id":"7a740942_b1125a08","line":44,"range":{"start_line":44,"start_character":47,"end_line":44,"end_character":64},"updated":"2015-12-09 12:10:37.000000000","message":"Need \u0027\u0027 around $allowed_consoles\n\nnit: and \"\" around $log_dir","commit_id":"bd04c73c542c10c02bb4543ee64d29da214751d2"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"a8e796d82734e1121d21b554b986b9fe97f47a9c","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"# Remove console files that do not correspond to valid last_dom_id\u0027s"},{"line_number":43,"context_line":"allowed_consoles\u003d\".*console.\\(${valid_last_dom_ids// /\\\\|}\\)$\""},{"line_number":44,"context_line":"delete_logs\u003d`find $log_dir -type f -not -regex $allowed_consoles`"},{"line_number":45,"context_line":"for log in $delete_logs; do"},{"line_number":46,"context_line":"    if echo $current_logs | grep -q -w $log; then"},{"line_number":47,"context_line":"        echo \"Deleting : $log\" | /usr/bin/logger -t $syslog_tag"}],"source_content_type":"text/x-sh","patch_set":2,"id":"3a7e1126_02740533","line":44,"range":{"start_line":44,"start_character":47,"end_line":44,"end_character":64},"in_reply_to":"7a740942_b1125a08","updated":"2015-12-17 13:15:13.000000000","message":"Can\u0027t use \u0027s as $allowed_consoles would not be evaluated.","commit_id":"bd04c73c542c10c02bb4543ee64d29da214751d2"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"511d9c3dab1b89769c69c947fecbbc9d94c519f0","unresolved":false,"context_lines":[{"line_number":43,"context_line":"allowed_consoles\u003d\".*console.\\(${valid_last_dom_ids// /\\\\|}\\)$\""},{"line_number":44,"context_line":"delete_logs\u003d`find $log_dir -type f -not -regex $allowed_consoles`"},{"line_number":45,"context_line":"for log in $delete_logs; do"},{"line_number":46,"context_line":"    if echo $current_logs | grep -q -w $log; then"},{"line_number":47,"context_line":"        echo \"Deleting : $log\" | /usr/bin/logger -t $syslog_tag"},{"line_number":48,"context_line":"        rm $log"},{"line_number":49,"context_line":"    fi"}],"source_content_type":"text/x-sh","patch_set":2,"id":"7a740942_97c86eaa","line":46,"updated":"2015-12-09 12:10:37.000000000","message":"nit: slightly neater:\n\n  grep -qw \"$log\" \u003c\u003c\u003c\"$current_logs\"","commit_id":"bd04c73c542c10c02bb4543ee64d29da214751d2"},{"author":{"_account_id":6735,"name":"Bob Ball","email":"bob.ball@citrix.com","username":"bob-ball"},"change_message_id":"b9dfb849208d0815ad44dddccaa617dd39edc4ef","unresolved":false,"context_lines":[{"line_number":43,"context_line":"allowed_consoles\u003d\".*console.\\(${valid_last_dom_ids// /\\\\|}\\)$\""},{"line_number":44,"context_line":"delete_logs\u003d`find $log_dir -type f -not -regex $allowed_consoles`"},{"line_number":45,"context_line":"for log in $delete_logs; do"},{"line_number":46,"context_line":"    if echo $current_logs | grep -q -w $log; then"},{"line_number":47,"context_line":"        echo \"Deleting : $log\" | /usr/bin/logger -t $syslog_tag"},{"line_number":48,"context_line":"        rm $log"},{"line_number":49,"context_line":"    fi"}],"source_content_type":"text/x-sh","patch_set":2,"id":"7a740942_78dcce74","line":46,"in_reply_to":"7a740942_97c86eaa","updated":"2015-12-09 13:52:33.000000000","message":"I had to look this up - so I\u0027d argue while it may be slightly neater we shouldn\u0027t be using it as it\u0027s not obvious to what it means or the implications of using \u003c\u003c\u003c.\nQuoting is not required in either case as log cannot contain spaces because it\u0027s part of the for loop.\nMore changes in the script would be required if log_dir ever contained spaces, or the filenames could contain spaces as if delete_logs contains any spaces other than to separate specific files, that would break.","commit_id":"bd04c73c542c10c02bb4543ee64d29da214751d2"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"511d9c3dab1b89769c69c947fecbbc9d94c519f0","unresolved":false,"context_lines":[{"line_number":44,"context_line":"delete_logs\u003d`find $log_dir -type f -not -regex $allowed_consoles`"},{"line_number":45,"context_line":"for log in $delete_logs; do"},{"line_number":46,"context_line":"    if echo $current_logs | grep -q -w $log; then"},{"line_number":47,"context_line":"        echo \"Deleting : $log\" | /usr/bin/logger -t $syslog_tag"},{"line_number":48,"context_line":"        rm $log"},{"line_number":49,"context_line":"    fi"},{"line_number":50,"context_line":"done"}],"source_content_type":"text/x-sh","patch_set":2,"id":"7a740942_37bada0b","line":47,"updated":"2015-12-09 12:10:37.000000000","message":"femtonit: space before colon","commit_id":"bd04c73c542c10c02bb4543ee64d29da214751d2"}]}
