<commit_before>#!/bin/bash

set -o errexit
set -o pipefail

#
# Call the tool of the same name in the 'sdc' zone.
#
# Note: That tool needs to be runnable from the GZ, i.e. calculates
# paths to files in the sdc zone *relative* to itself, etc.
#
ufds_admin_uuid=$(bash /lib/sdc/config.sh -json | json ufds_admin_uuid)
sdc_zone=$(vmadm list -H -o tags.smartdc_role,uuid,create_timestamp \
           -s create_timestamp owner_uuid=$ufds_admin_uuid | grep '^sdc\>' | \
           tail -1 | awk '{print $2}')
if [[ -z "${sdc_zone}" ]]; then
    # BASHSTYLED
    echo "error: $(basename $0): unable to find a 'sdc' core zone on this node" >&2
    exit 1
fi
exec /zones/$sdc_zone/root/opt/smartdc/sdc/bin/$(basename $0) "$@"<commit_msg>HEAD-2117: wrap.sh doesn't show error message when no 'sdc' zone on GZ<commit_after>#!/bin/bash
#
# Call the tool of the same name in the 'sdc' zone.
#
# Note: That tool needs to be runnable from the GZ, i.e. calculates
# paths to files in the sdc zone *relative* to itself, etc.
#

if [[ -n "$TRACE" ]]; then
    export PS4='[\D{%FT%TZ}] ${BASH_SOURCE}:${LINENO}: ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
    set -o xtrace
fi
set -o errexit
set -o pipefail

ufds_admin_uuid=$(bash /lib/sdc/config.sh -json | json ufds_admin_uuid)
sdc_zone=$(vmadm list -H -o tags.smartdc_role,uuid,create_timestamp \
           -s create_timestamp owner_uuid=$ufds_admin_uuid | \
           (grep '^sdc\>' || true) | \
           tail -1 | awk '{print $2}')
if [[ -z "${sdc_zone}" ]]; then
    # BASHSTYLED
    echo "error: $(basename $0): unable to find a 'sdc' core zone on this node" >&2
    exit 1
fi
exec /zones/$sdc_zone/root/opt/smartdc/sdc/bin/$(basename $0) "$@"
{'fraction_non_alphanumeric': 0.1570493753718025, 'fraction_numerical': 0.011302795954788817, 'mean_word_length': 3.3017902813299234, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7012691', 'n_tokens_mistral': 658, 'n_tokens_neox': 640, 'n_words': 198}