}
release() {
- if [ -r /etc/lsb-release ]; then
- dist=$(grep 'DISTRIB_ID' /etc/lsb-release | sed 's/DISTRIB_ID=//' | head -1)
- elif [ -r /etc/redhat-release ]; then
- dist=$(awk '/release/ { printf("%s %s %s", $1, $2, $3)}' /etc/redhat-release)
- elif [ -r /etc/*-release ]; then
- dist=$(find /etc/ -maxdepth 1 -name '*release' 2> /dev/null | \
- sed -e 's/\/etc\///' -e 's/-release//' | head -1)
- else
- dist="UNKNOWN"
- fi
+ if [ -r /etc/lsb-release ]; then
+ dist=$(sed -ne '/^DISTRIB_ID/s/DISTRIB_ID=//p' /etc/lsb-release)
+ elif [ -r /etc/redhat-release ]; then
+ dist=$(awk '/release/ { printf("%s %s %s", $1, $2, $3) }' \
+ /etc/redhat-release)
+ elif [ -r /etc/*-release ]; then
+ dist=$(find /etc/ -maxdepth 1 -name '*release' 2> /dev/null |
+ sed -e 's/\/etc\///' -e 's/-release//' | head -n1)
+ else
+ dist="UNKNOWN"
+ fi
- echo $dist
+ echo $dist
}
yml_build_info() {
- local TEST_DISTRO=$(release)
- local LUSTRE_VERSION=$(lctl lustre_build_version | awk '/Lustre version:/ {print $3}')
- local LUSTRE_BUILD=${LUSTRE_BUILD_SOURCE:-$(sed 's/-.*//' <<<$LUSTRE_VERSION)}
- local FILE_SYSTEM=$(node_fstypes $(hostname -s))
+ local TEST_DISTRO=$(release)
+ local LUSTRE_VERSION=$(lustre_build_version)
+ local LUSTRE_BUILD=${LUSTRE_BUILD_SOURCE:-$LUSTRE_VERSION}
+ local FILE_SYSTEM=$(node_fstypes $(hostname -s))
cat <<EOF
lbats_build_id: $LBATS_ID