Merge ~bladernr/plainbox-provider-certification-server:1878701 into plainbox-provider-certification-server:master

Proposed by Jeff Lane 
Status: Merged
Approved by: Jeff Lane 
Approved revision: 347b54bf01c94fa0be02a1f11ccefbd3a6b72081
Merged at revision: 135e599690877e0a676f42c0b00ca1c25dedfd49
Proposed branch: ~bladernr/plainbox-provider-certification-server:1878701
Merge into: plainbox-provider-certification-server:master
Diff against target: 37 lines (+16/-10)
1 file modified
tools/canonical-certification-precheck (+16/-10)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+392012@code.launchpad.net

Description of the change

fixed bug in precheck script when lvmdiskscan does not exist (found when testing a small arm board)

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tools/canonical-certification-precheck b/tools/canonical-certification-precheck
2index c8ba2c4..c785108 100755
3--- a/tools/canonical-certification-precheck
4+++ b/tools/canonical-certification-precheck
5@@ -174,17 +174,23 @@ fi
6 LVM_Check(){
7 name="LVM Check"
8 echoname
9-local lvmCount=$(sudo lvmdiskscan | awk '/[0-9] LVM/ {print $1}' | tr -d -c 0-9)
10-local lvmList=($(sudo lvmdiskscan | awk '/] LVM/ {print $1}'))
11-if [ "$lvmCount" -eq "0" ]; then
12- echo -e " LVM not present."
13- pass
14+if [ -x "$(command -v lvmdiskscan)" ]; then
15+ local lvmCount=$(sudo lvmdiskscan | awk '/[0-9] LVM/ {print $1}' | tr -d -c 0-9)
16+ local lvmList=($(sudo lvmdiskscan | awk '/] LVM/ {print $1}'))
17+ if [ "$lvmCount" -eq "0" ]; then
18+ echo -e " LVM not present."
19+ pass
20+ else
21+ echo -e " LVM members found:"
22+ for element in "${lvmList[@]}"; do
23+ echo -e " ${element}"
24+ done
25+ fail
26+ fi
27 else
28- echo -e " LVM members found:"
29- for element in "${lvmList[@]}"; do
30- echo -e " ${element}"
31- done
32- fail
33+ echo -e " lvmdiskscan command not found. Skipping this check."
34+ echo -e " You should manually verify that LVM volumes are not present."
35+ fail
36 fi
37 }
38

Subscribers

People subscribed via source and target branches