Skip to content

Commit

Permalink
Simplify date in metadata to year-month-day
Browse files Browse the repository at this point in the history
Change-Id: I22cf527bbc2cf7ae5a1ea9221413ad7138b1c566
  • Loading branch information
iranzo committed Oct 26, 2018
1 parent b80e149 commit 1a3a3c9
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions citellusclient/plugins/metadata/system/sosreport-date.sh
Expand Up @@ -24,16 +24,12 @@
[[ -f "${CITELLUS_BASE}/common-functions.sh" ]] && . "${CITELLUS_BASE}/common-functions.sh"

if [[ ${CITELLUS_LIVE} -eq 0 ]]; then
FILE="${CITELLUS_ROOT}/date"
elif [[ ${CITELLUS_LIVE} -eq 1 ]];then
FILE=$(mktemp)
trap "rm ${FILE}" EXIT
LANG=C TZ='UTC' date > ${FILE}
sosdate=$(LANG=C date -d "$(cat ${CITELLUS_ROOT}/date)" +%Y-%m-%d)
else
sosdate=$(LANG=C TZ='UTC' date +%Y-%m-%d)
fi


# Fill metadata 'sosreport-date' to value
echo "sosreport-date"
cat ${FILE} >&2
echo ${sosdate} >&2
exit ${RC_OKAY}

0 comments on commit 1a3a3c9

Please sign in to comment.