diff --git a/roles/build-containers/tasks/post.yaml b/roles/build-containers/tasks/post.yaml index aa9433c84..770b46867 100644 --- a/roles/build-containers/tasks/post.yaml +++ b/roles/build-containers/tasks/post.yaml @@ -20,22 +20,10 @@ rsync -var --no-links /etc/containers/ {{ workspace }}/etc/containers/ || true rsync -var --no-links --include 'yum.repos.d/***' --include 'yum.conf' --include 'dnf/***' --exclude='*' /etc/ {{ workspace }}/etc/ || true - gzip -r "{{ workspace }}/logs" "{{ workspace }}/conf" "{{ workspace }}/etc" chmod -R a+r "{{ workspace }}" chown -R {{ ansible_user }}: "{{ workspace }}" changed_when: true -- name: Rename compressed text based files to end with txt.gz extension - become: true - shell: > - set -o pipefail && - find {{ workspace }}/logs {{ workspace }}/conf {{ workspace }}/etc -type f | - awk 'function rename(orig) - { new=orig; sub(/\.gz$/, ".txt.gz", new); system("mv " orig " " new) } - /\.(conf|ini|json|sh|log|yaml|yml|repo|cfg|j2|py)\.gz$/ { rename($0) } - /(\/logs\/|\/etc\/)[^ \/\.]+\.gz$/ { rename($0) }'; - changed_when: true - - name: Copy files from {{ ansible_user_dir }}/workspace/ on node no_log: true synchronize: diff --git a/roles/run-test/templates/common_vars.bash.j2 b/roles/run-test/templates/common_vars.bash.j2 index 6dc2e8b4d..4f1b0bde1 100644 --- a/roles/run-test/templates/common_vars.bash.j2 +++ b/roles/run-test/templates/common_vars.bash.j2 @@ -54,4 +54,4 @@ SSH_OPTIONS='-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogL # NOTE(pabelanger): this logic should be inverted to only include what developers need, not exclude things on the filesystem. TARCMD="sudo XZ_OPT=-3 tar -cJf - --exclude=var/log/journal --exclude=udev/hwdb.bin --exclude=etc/puppet/modules --exclude=etc/project-config --exclude=etc/services --exclude=selinux/targeted --exclude=etc/services --exclude=etc/pki /var/log /etc" -JLOGCMD="sudo journalctl --output short-precise | gzip -c | sudo dd of=/var/log/journal-text.txt.gz" +JLOGCMD="sudo journalctl --output short-precise | sudo dd of=/var/log/journal-text.txt" diff --git a/roles/run-test/templates/oooq_common_functions.sh.j2 b/roles/run-test/templates/oooq_common_functions.sh.j2 index d052924f5..73add90b1 100644 --- a/roles/run-test/templates/oooq_common_functions.sh.j2 +++ b/roles/run-test/templates/oooq_common_functions.sh.j2 @@ -98,12 +98,10 @@ source $LOCAL_WORKING_DIR/bin/activate set -u source $OOOQ_DIR/ansible_ssh_env.sh -sudo unbound-control dump_cache > /tmp/dns_cache.txt -sudo chown {{ ansible_user_id }}: /tmp/dns_cache.txt -cat /tmp/dns_cache.txt | gzip - > $LOGS_DIR/dns_cache.txt.gz +sudo unbound-control dump_cache > $LOGS_DIR/dns_cache.txt mkdir -p $LOGS_DIR/quickstart_files -find $LOCAL_WORKING_DIR -maxdepth 1 -type f -not -name "*sqlite" | while read i; do gzip -cf \$i > $LOGS_DIR/quickstart_files/\$(basename \$i).txt.gz; done +find $LOCAL_WORKING_DIR -maxdepth 1 -type f -not -name "*sqlite" | while read i; do cp -l \$i $LOGS_DIR/quickstart_files/\$(basename \$i); done $QUICKSTART_COLLECTLOGS_CMD > $LOGS_DIR/quickstart_collect_logs.log || \ echo "WARNING: quickstart collect-logs failed, check quickstart_collectlogs.log for details" diff --git a/scripts/common_vars.bash b/scripts/common_vars.bash index cad320216..ee1c0b27d 100644 --- a/scripts/common_vars.bash +++ b/scripts/common_vars.bash @@ -54,4 +54,4 @@ SSH_OPTIONS='-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogL # NOTE(pabelanger): this logic should be inverted to only include what developers need, not exclude things on the filesystem. TARCMD="sudo XZ_OPT=-3 tar -cJf - --exclude=var/log/journal --exclude=udev/hwdb.bin --exclude=etc/puppet/modules --exclude=etc/project-config --exclude=etc/services --exclude=selinux/targeted --exclude=etc/services --exclude=etc/pki /var/log /etc" -JLOGCMD="sudo journalctl --output short-precise | gzip -c | sudo dd of=/var/log/journal-text.txt.gz" +JLOGCMD="sudo journalctl --output short-precise | sudo dd of=/var/log/journal-text.txt" diff --git a/scripts/te-broker/destroy-env b/scripts/te-broker/destroy-env index 2958565f4..54b793b1f 100755 --- a/scripts/te-broker/destroy-env +++ b/scripts/te-broker/destroy-env @@ -38,7 +38,7 @@ nova console-log bmc-${ENVNUM} | tail -n 100 | awk -v envnum="$ENVNUM" '$0=envnu # Save all the consoles in the stack to a dedicated directory, stripping out ANSI color codes. for server in $(openstack server list -f value -c Name | grep baremetal-${ENVNUM}) bmc-$ENVNUM ; do - openstack console log show $server | sed 's/\[[0-9;]*[a-zA-Z]//g' | gzip > $CONSOLE_LOG_PATH/$server-console.log.gz || true + openstack console log show $server | sed 's/\[[0-9;]*[a-zA-Z]//g' > $CONSOLE_LOG_PATH/$server-console.log || true done diff --git a/toci_quickstart.sh b/toci_quickstart.sh index 61b2adb22..a7ebb93fd 100755 --- a/toci_quickstart.sh +++ b/toci_quickstart.sh @@ -185,15 +185,13 @@ fi popd -sudo unbound-control dump_cache > /tmp/dns_cache.txt -sudo chown ${USER}: /tmp/dns_cache.txt -cat /tmp/dns_cache.txt | gzip - > $LOGS_DIR/dns_cache.txt.gz +sudo unbound-control dump_cache > $LOGS_DIR/dns_cache.txt if [[ "$PERIODIC" == 1 && -e $WORKSPACE/hash_info.sh ]] ; then echo export JOB_EXIT_VALUE=$exit_value >> $WORKSPACE/hash_info.sh fi mkdir -p $LOGS_DIR/quickstart_files -find $LOCAL_WORKING_DIR -maxdepth 1 -type f -not -name "*sqlite" | while read i; do gzip -cf $i > $LOGS_DIR/quickstart_files/$(basename $i).txt.gz; done +find $LOCAL_WORKING_DIR -maxdepth 1 -type f -not -name "*sqlite" | while read i; do cp -l $i $LOGS_DIR/quickstart_files/$(basename $i); done echo 'Quickstart completed.' exit $exit_value