<commit_before>source /home/jenkins-slave/keystonerc_admin
source /usr/local/src/nova-ci/jobs/library.sh

set +e

echo "Collecting logs"
ssh -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" -i /home/jenkins-slave/admin-msft.pem ubuntu@$FLOATING_IP "/home/ubuntu/bin/collect_logs.sh"

if [ "$IS_DEBUG_JOB" != "yes" ]
	then
		echo "Detaching and cleaning Hyper-V node 1"
		teardown_hyperv $hyperv01
		echo "Detaching and cleaning Hyper-V node 2"
		teardown_hyperv $hyperv02
		echo "Creating logs destination folder"
		ssh -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" -i /home/jenkins-slave/norman.pem <EMAIL> "if [ -z '$ZUUL_CHANGE' ] || [ -z '$ZUUL_PATCHSET' ]; then echo 'Missing parameters!'; exit 1; elif [ ! -d /srv/logs/$ZUUL_CHANGE/$ZUUL_PATCHSET ]; then mkdir -p /srv/logs/$ZUUL_CHANGE/$ZUUL_PATCHSET; else rm -rf /srv/logs/$ZUUL_CHANGE/$ZUUL_PATCHSET/*; fi"

		echo "Downloading logs"
		scp -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" -i /home/jenkins-slave/admin-msft.pem ubuntu@$FLOATING_IP:/home/ubuntu/aggregate.tar.gz "aggregate-$NAME.tar.gz"

		echo "Uploading logs"
		scp -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" -i /home/jenkins-slave/norman.pem "aggregate-$NAME.tar.gz" <EMAIL>:/srv/logs/$ZUUL_CHANGE/$ZUUL_PATCHSET/aggregate-logs.tar.gz
		gzip -9 /home/jenkins-slave/logs/console-$NAME.log
		scp -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" -i /home/jenkins-slave/norman.pem "/home/jenkins-slave/logs/console-$NAME.log.gz" <EMAIL>:/srv/logs/$ZUUL_CHANGE/$ZUUL_PATCHSET/console.log.gz && rm -f /home/jenkins-slave/logs/console-$NAME.log.gz

		echo "Extracting logs"
		ssh -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" -i /home/jenkins-slave/norman.pem <EMAIL> "tar -xzf /srv/logs/$ZUUL_CHANGE/$ZUUL_PATCHSET/aggregate-logs.tar.gz -C /srv/logs/$ZUUL_CHANGE/$ZUUL_PATCHSET/"
    
		echo "Fixing permissions on all log files"
		ssh -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" -i /home/jenkins-slave/norman.pem <EMAIL> "chmod a+rx -R /srv/logs/$ZUUL_CHANGE/$ZUUL_PATCHSET"
    
		echo "Releasing devstack floating IP"
		nova remove-floating-ip "$NAME" "$FLOATING_IP"
		echo "Removing devstack VM"
		nova delete "$NAME"
		/usr/local/src/ci-overcloud-init-scripts/vlan_allocation.py -r $NAME
		echo "Deleting devstack floating IP"
		nova floating-ip-delete "$FLOATING_IP"
		rm -f /home/jenkins-slave/runs/devstack_params.$ZUUL_UUID.$JOB_TYPE.txt
	else
		TIMESTAMP=$(date +%d-%m-%Y_%H-%M)
        echo "Creating logs destination folder"
        ssh -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" -i /home/jenkins-slave/norman.pem <EMAIL>@logs.openstack.tld "if [ -z '$ZUUL_CHANGE' ] || [ -z '$ZUUL_PATCHSET' ]; then echo 'Missing parameters!'; exit 1; elif [ ! -d /srv/logs/debug/$ZUUL_CHANGE/$ZUUL_PATCHSET/$TIMESTAMP ]; then mkdir -p /srv/logs/debug/$ZUUL_CHANGE/$ZUUL_PATCHSET/$TIMESTAMP; else rm -rf /srv/logs/debug/$ZUUL_CHANGE/$ZUUL_PATCHSET/$TIMESTAMP/*; fi"

		echo "Downloading logs"<commit_msg>Fixed typo in path on run_collect_logs.sh<commit_after>source /home/jenkins-slave/keystonerc_admin
source /usr/local/src/nova-ci/jobs/library.sh

set +e

echo "Collecting logs"
ssh -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" -i /home/jenkins-slave/admin-msft.pem ubuntu@$FLOATING_IP "/home/ubuntu/bin/collect_logs.sh"

if [ "$IS_DEBUG_JOB" != "yes" ]
	then
		echo "Detaching and cleaning Hyper-V node 1"
		teardown_hyperv $hyperv01
		echo "Detaching and cleaning Hyper-V node 2"
		teardown_hyperv $hyperv02
		echo "Creating logs destination folder"
		ssh -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" -i /home/jenkins-slave/norman.pem logs@logs.openstack.tld "if [ -z '$ZUUL_CHANGE' ] || [ -z '$ZUUL_PATCHSET' ]; then echo 'Missing parameters!'; exit 1; elif [ ! -d /srv/logs/$ZUUL_CHANGE/$ZUUL_PATCHSET ]; then mkdir -p /srv/logs/$ZUUL_CHANGE/$ZUUL_PATCHSET; else rm -rf /srv/logs/$ZUUL_CHANGE/$ZUUL_PATCHSET/*; fi"

		echo "Downloading logs"
		scp -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" -i /home/jenkins-slave/admin-msft.pem ubuntu@$FLOATING_IP:/home/ubuntu/aggregate.tar.gz "aggregate-$NAME.tar.gz"

		echo "Uploading logs"
		scp -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" -i /home/jenkins-slave/norman.pem "aggregate-$NAME.tar.gz" <EMAIL>:/srv/logs/$ZUUL_CHANGE/$ZUUL_PATCHSET/aggregate-logs.tar.gz
		gzip -9 /home/jenkins-slave/logs/console-$NAME.log
		scp -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" -i /home/jenkins-slave/norman.pem "/home/jenkins-slave/logs/console-$NAME.log.gz" <EMAIL>:/srv/logs/$ZUUL_CHANGE/$ZUUL_PATCHSET/console.log.gz && rm -f /home/jenkins-slave/logs/console-$NAME.log.gz

		echo "Extracting logs"
		ssh -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" -i /home/jenkins-slave/norman.pem <EMAIL> "tar -xzf /srv/logs/$ZUUL_CHANGE/$ZUUL_PATCHSET/aggregate-logs.tar.gz -C /srv/logs/$ZUUL_CHANGE/$ZUUL_PATCHSET/"
    
		echo "Fixing permissions on all log files"
		ssh -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" -i /home/jenkins-slave/norman.pem <EMAIL> "chmod a+rx -R /srv/logs/$ZUUL_CHANGE/$ZUUL_PATCHSET"
    
		echo "Releasing devstack floating IP"
		nova remove-floating-ip "$NAME" "$FLOATING_IP"
		echo "Removing devstack VM"
		nova delete "$NAME"
		/usr/local/src/nova-ci/vlan_allocation.py -r $NAME
		echo "Deleting devstack floating IP"
		nova floating-ip-delete "$FLOATING_IP"
		rm -f /home/jenkins-slave/runs/devstack_params.$ZUUL_UUID.$JOB_TYPE.txt
	else
		TIMESTAMP=$(date +%d-%m-%Y_%H-%M)
        echo "Creating logs destination folder"
        ssh -o "UserKnownHostsFile /dev/null" -o "StrictHostKeyChecking no" -i /home/jenkins-slave/norman.pem <EMAIL>.openstack.tld "if [ -z '$ZUUL_CHANGE' ] || [ -z '$ZUUL_PATCHSET' ]; then echo 'Missing parameters!'; exit 1; elif [ ! -d /srv/logs/debug/$ZUUL_CHANGE/$ZUUL_PATCHSET/$TIMESTAMP ]; then mkdir -p /srv/logs/debug/$ZUUL_CHANGE/$ZUUL_PATCHSET/$TIMESTAMP; else rm -rf /srv/logs/debug/$ZUUL_CHANGE/$ZUUL_PATCHSET/$TIMESTAMP/*; fi"

		echo "Downloading logs"
{'fraction_non_alphanumeric': 0.14912993982761424, 'fraction_numerical': 0.002927305252886648, 'mean_word_length': 4.216284987277354, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4977120', 'n_tokens_mistral': 2604, 'n_tokens_neox': 2490, 'n_words': 480}