fault/fm-doc/fm_doc/checkEventYaml
Dean Troyer 6cd8940170 StarlingX open source release updates
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2018-05-31 07:36:00 -07:00

34 lines
742 B
Bash
Executable File

#!/bin/bash -e
#
# Copyright (c) 2016 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
USAGE="usage: ${0##*/} [ <fmEventDoc.yaml> ]"
FMEVENTDOC_YAMLFILE="events.yaml"
if [ "$#" -gt 0 ]
then
FMEVENTDOC_YAMLFILE=$1
fi
echo "File: " ${FMEVENTDOC_YAMLFILE}
echo "Checking for duplicate records ..."
DUP_LINES=$(cat ${FMEVENTDOC_YAMLFILE} | egrep "^[0-9]" | cut --characters=1-7 | sort | uniq -d | wc -l)
if [ ${DUP_LINES} -gt 0 ]; then
echo "ERROR Duplicate records defined:"
cat ${FMEVENTDOC_YAMLFILE} | egrep "^[0-9]" | cut --characters=1-7 | sort | uniq -d
echo
echo "Done"
exit 1
fi
python parseEventYaml.py ${FMEVENTDOC_YAMLFILE}
python check_missing_alarms.py ${FMEVENTDOC_YAMLFILE}
exit $?