)]}'
{"scripts/scripts-library.sh":[{"author":{"_account_id":22042,"name":"Chris Smart","email":"distroguy@gmail.com","username":"csmart"},"change_message_id":"ef47dde73f26c643642be9724fc023362c8a6fc5","unresolved":false,"context_lines":[{"line_number":139,"context_line":"    mkdir -p \"${GATE_LOG_DIR}/host\" \"${GATE_LOG_DIR}/openstack\""},{"line_number":140,"context_line":"    rsync -av --ignore-errors /var/log/ \"${GATE_LOG_DIR}/host\" || true"},{"line_number":141,"context_line":"    rsync -av --ignore-errors /openstack/log/ \"${GATE_LOG_DIR}/openstack\" || true"},{"line_number":142,"context_line":"    find \"${GATE_LOG_DIR}\" -type f ! -name \u0027*.gz\u0027 -exec \"$(which gzip)\" --best \"{}\" \\;"},{"line_number":143,"context_line":"    chmod -R 0777 \"${GATE_LOG_DIR}\""},{"line_number":144,"context_line":"  fi"},{"line_number":145,"context_line":"}"}],"source_content_type":"text/x-sh","patch_set":6,"id":"9a89bdaa_6e1bc373","line":142,"updated":"2016-09-07 11:47:23.000000000","message":"Nit: Looks good, although $(which gzip) is probably not needed? I expect \"which\" will just return the first result from $PATH anyway, so may as well just call gzip directly. Although gzip is listed in bindep, if it\u0027s not in the path (for some reason) then find will probably try to execute \"--best\" which could be misleading when tracking own an issue.","commit_id":"9a50721998b9ed2ecf05ea7656856ad7e6fd792d"},{"author":{"_account_id":6816,"name":"Jesse Pretorius","email":"jesse@odyssey4.me","username":"jesse-pretorius"},"change_message_id":"bce5066a3e1605a09cf448121db5aafe0eb5e405","unresolved":false,"context_lines":[{"line_number":139,"context_line":"    mkdir -p \"${GATE_LOG_DIR}/host\" \"${GATE_LOG_DIR}/openstack\""},{"line_number":140,"context_line":"    rsync -av --ignore-errors /var/log/ \"${GATE_LOG_DIR}/host\" || true"},{"line_number":141,"context_line":"    rsync -av --ignore-errors /openstack/log/ \"${GATE_LOG_DIR}/openstack\" || true"},{"line_number":142,"context_line":"    find \"${GATE_LOG_DIR}\" -type f ! -name \u0027*.gz\u0027 -exec \"$(which gzip)\" --best \"{}\" \\;"},{"line_number":143,"context_line":"    chmod -R 0777 \"${GATE_LOG_DIR}\""},{"line_number":144,"context_line":"  fi"},{"line_number":145,"context_line":"}"}],"source_content_type":"text/x-sh","patch_set":6,"id":"9a89bdaa_ce376ffd","line":142,"in_reply_to":"9a89bdaa_6e1bc373","updated":"2016-09-07 11:54:48.000000000","message":"The reason for using $(which gzip) is so that I get the full path and thus hopefully avoid encountering an alias. This is necessary because on the last successful test of this, for some reason gzip is not doing what it normally does (remove the original file after compressing it). See http://logs.openstack.org/70/366570/4/check/gate-openstack-ansible-openstack-ansible-aio-ubuntu-trusty/3e14efb/logs/host/\n\nIf you have any ideas for a better implementation, I\u0027m all ears. :)","commit_id":"9a50721998b9ed2ecf05ea7656856ad7e6fd792d"},{"author":{"_account_id":22042,"name":"Chris Smart","email":"distroguy@gmail.com","username":"csmart"},"change_message_id":"f3d314f38658f616e61ba0795f6c64b455238d87","unresolved":false,"context_lines":[{"line_number":139,"context_line":"    mkdir -p \"${GATE_LOG_DIR}/host\" \"${GATE_LOG_DIR}/openstack\""},{"line_number":140,"context_line":"    rsync -av --ignore-errors /var/log/ \"${GATE_LOG_DIR}/host\" || true"},{"line_number":141,"context_line":"    rsync -av --ignore-errors /openstack/log/ \"${GATE_LOG_DIR}/openstack\" || true"},{"line_number":142,"context_line":"    find \"${GATE_LOG_DIR}\" -type f ! -name \u0027*.gz\u0027 -exec \"$(which gzip)\" --best \"{}\" \\;"},{"line_number":143,"context_line":"    chmod -R 0777 \"${GATE_LOG_DIR}\""},{"line_number":144,"context_line":"  fi"},{"line_number":145,"context_line":"}"}],"source_content_type":"text/x-sh","patch_set":6,"id":"9a89bdaa_c1d39ed3","line":142,"in_reply_to":"9a89bdaa_ce376ffd","updated":"2016-09-07 23:29:17.000000000","message":"Thanks for the reply, makes sense. You could probably just add \"command\" instead, to make it ignore aliases, i.e.\n-exec command gzip --best {} ;\\\n\nAs for not removing the original file, I don\u0027t think I\u0027ve seen that with find before. It\u0027s kinda like some process still has a file handler open or something. Piping to |xargs instead might help, although I see you have a newer version that is working :-)","commit_id":"9a50721998b9ed2ecf05ea7656856ad7e6fd792d"},{"author":{"_account_id":22042,"name":"Chris Smart","email":"distroguy@gmail.com","username":"csmart"},"change_message_id":"ef47dde73f26c643642be9724fc023362c8a6fc5","unresolved":false,"context_lines":[{"line_number":140,"context_line":"    rsync -av --ignore-errors /var/log/ \"${GATE_LOG_DIR}/host\" || true"},{"line_number":141,"context_line":"    rsync -av --ignore-errors /openstack/log/ \"${GATE_LOG_DIR}/openstack\" || true"},{"line_number":142,"context_line":"    find \"${GATE_LOG_DIR}\" -type f ! -name \u0027*.gz\u0027 -exec \"$(which gzip)\" --best \"{}\" \\;"},{"line_number":143,"context_line":"    chmod -R 0777 \"${GATE_LOG_DIR}\""},{"line_number":144,"context_line":"  fi"},{"line_number":145,"context_line":"}"},{"line_number":146,"context_line":""}],"source_content_type":"text/x-sh","patch_set":6,"id":"9a89bdaa_4ef8bfc3","line":143,"updated":"2016-09-07 11:47:23.000000000","message":"n00b question and side note, should everything really be 777? I expect there may be sensitive information in the logs?","commit_id":"9a50721998b9ed2ecf05ea7656856ad7e6fd792d"},{"author":{"_account_id":22042,"name":"Chris Smart","email":"distroguy@gmail.com","username":"csmart"},"change_message_id":"f0cbb080a903a0050e5f7fe565e3b1134a1ef755","unresolved":false,"context_lines":[{"line_number":140,"context_line":"    rsync -av --ignore-errors /var/log/ \"${GATE_LOG_DIR}/host\" || true"},{"line_number":141,"context_line":"    rsync -av --ignore-errors /openstack/log/ \"${GATE_LOG_DIR}/openstack\" || true"},{"line_number":142,"context_line":"    find \"${GATE_LOG_DIR}\" -type f ! -name \u0027*.gz\u0027 -exec \"$(which gzip)\" --best \"{}\" \\;"},{"line_number":143,"context_line":"    chmod -R 0777 \"${GATE_LOG_DIR}\""},{"line_number":144,"context_line":"  fi"},{"line_number":145,"context_line":"}"},{"line_number":146,"context_line":""}],"source_content_type":"text/x-sh","patch_set":6,"id":"9a89bdaa_6ed90322","line":143,"in_reply_to":"9a89bdaa_4ef8bfc3","updated":"2016-09-07 11:48:24.000000000","message":"Oh, it\u0027s just for gate anyway, so OK. Never mind!","commit_id":"9a50721998b9ed2ecf05ea7656856ad7e6fd792d"},{"author":{"_account_id":6816,"name":"Jesse Pretorius","email":"jesse@odyssey4.me","username":"jesse-pretorius"},"change_message_id":"bce5066a3e1605a09cf448121db5aafe0eb5e405","unresolved":false,"context_lines":[{"line_number":140,"context_line":"    rsync -av --ignore-errors /var/log/ \"${GATE_LOG_DIR}/host\" || true"},{"line_number":141,"context_line":"    rsync -av --ignore-errors /openstack/log/ \"${GATE_LOG_DIR}/openstack\" || true"},{"line_number":142,"context_line":"    find \"${GATE_LOG_DIR}\" -type f ! -name \u0027*.gz\u0027 -exec \"$(which gzip)\" --best \"{}\" \\;"},{"line_number":143,"context_line":"    chmod -R 0777 \"${GATE_LOG_DIR}\""},{"line_number":144,"context_line":"  fi"},{"line_number":145,"context_line":"}"},{"line_number":146,"context_line":""}],"source_content_type":"text/x-sh","patch_set":6,"id":"9a89bdaa_0e15d747","line":143,"in_reply_to":"9a89bdaa_6ed90322","updated":"2016-09-07 11:54:48.000000000","message":"Yes, this is because this script is executed as root, so it has access to all the files, but the file upload is handled by the \u0027jenkins\u0027 non-root user which does not have access to all the files. By doing this we ensure that jenkins can read all the files to upload them on to the log server!","commit_id":"9a50721998b9ed2ecf05ea7656856ad7e6fd792d"}]}
