Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion files/metrics_import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ for f in /opt/mft-automations/puppet_enterprise_support*gz \
fi
fi

if ! tar tf "$f" | grep -q -m 1 'metrics\/.*json'; then
# Check if the archive contains any metrics JSON files
json_count=$(tar -tzf "$f" | grep -c '^metrics/.*\.json$')

if [ "$json_count" -gt 0 ]; then
echo "Found $json_count JSON file(s)"
else
log "No metrics found in $f. Skipping"
rm -- "$f"
continue
Expand Down