Merge ~pjdc/ubuntu-mirror-charm/+git/ubuntu-mirror-charm:check-updates-fail-harder into ubuntu-mirror-charm:master

Proposed by Paul Collins
Status: Merged
Approved by: Haw Loeung
Approved revision: 91767a1476c15bd3dded4ee1aba12db60077c723
Merged at revision: 104c0db7fefab365baa34244f118b11dee7246e2
Proposed branch: ~pjdc/ubuntu-mirror-charm/+git/ubuntu-mirror-charm:check-updates-fail-harder
Merge into: ubuntu-mirror-charm:master
Diff against target: 15 lines (+5/-0)
1 file modified
files/check-updates.sh (+5/-0)
Reviewer Review Type Date Requested Status
Haw Loeung +1 Approve
Canonical IS Reviewers Pending
Review via email: mp+389053@code.launchpad.net

Commit message

check-updates.sh: we want a critical when the file we're checking doesn't exist

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Haw Loeung (hloeung) wrote :

LGTM

review: Approve (+1)
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 104c0db7fefab365baa34244f118b11dee7246e2

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/files/check-updates.sh b/files/check-updates.sh
2index fbe7aae..86b3a1d 100755
3--- a/files/check-updates.sh
4+++ b/files/check-updates.sh
5@@ -18,6 +18,11 @@ fi
6 NAME=$1
7 LOGFILE=$2
8
9+if [ ! -r ${LOGFILE} ]; then
10+ echo "CRITICAL Cannot determine ${NAME} update status [${LOGFILE} does not exist or is not readable]"
11+ exit 2
12+fi
13+
14 now=$(date +"%s")
15 file_mtime=$(stat --format="%Y" ${LOGFILE})
16

Subscribers

People subscribed via source and target branches