Merge ~bladernr/plainbox-provider-certification-server:1729351-fix-lxd-precheck into plainbox-provider-certification-server:master

Proposed by Jeff Lane 
Status: Merged
Merged at revision: 35100c0d40f8af09232112df5969a0f2680ad986
Proposed branch: ~bladernr/plainbox-provider-certification-server:1729351-fix-lxd-precheck
Merge into: plainbox-provider-certification-server:master
Diff against target: 72 lines (+12/-4)
1 file modified
tools/canonical-certification-precheck (+12/-4)
Reviewer Review Type Date Requested Status
Jeff Lane  Approve
Review via email: mp+333080@code.launchpad.net

Description of the change

Fix the LXD precheck bits to be more explicit about what we need when we ask for a URL to the LXD files even when locally hosted.

To post a comment you must log in.
Revision history for this message
Jeff Lane  (bladernr) wrote :

Been a week, self-approve.

review: Approve
Revision history for this message
Jeff Lane  (bladernr) wrote :

The merge was fine but running tests failed.

review: Needs Fixing
Revision history for this message
Jeff Lane  (bladernr) wrote :

approve

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 c87c2ae..0e802eb 100755
3--- a/tools/canonical-certification-precheck
4+++ b/tools/canonical-certification-precheck
5@@ -389,10 +389,12 @@ if grep "^LXD_TEMPLATE =" /etc/xdg/canonical-certification.conf >/dev/null; then
6 echo -e " $templateurl is a valid url.\n Continuing to use this template file"
7 pass
8 else
9+ echo -e " NOTE: For the following, you must provide a valid URL beginning with http://,"
10+ echo -e " https://, or file://"
11 echo -e " $templateurl is not a valid url.\n Would you like to reconfigure it now? [Y/n]"
12 read -s -N1 a
13 if [[ $a == "Y" || $a == "y" || -z $a ]]; then
14- read -e -p " Enter the path of your LXD Template File: " template
15+ read -e -p " Enter the URL of your LXD Template File: " template
16 sudo sed -i "s,LXD_TEMPLATE =.*,LXD_TEMPLATE = $template,g" /etc/xdg/canonical-certification.conf
17 templateurl=$(grep ^LXD_TEMPLATE /etc/xdg/canonical-certification.conf|awk '{print $3}')
18 if curl --output /dev/null --silent --head -fail "$templateurl"; then
19@@ -400,7 +402,7 @@ if grep "^LXD_TEMPLATE =" /etc/xdg/canonical-certification.conf >/dev/null; then
20 pass
21 return 0
22 else
23- echo -e " We cannot get the LXD template image from $kvmurl.\n Marking as failed"
24+ echo -e " We cannot get the LXD template image from $templateurl.\n Marking as failed"
25 fail
26 return 0
27 fi
28@@ -413,6 +415,8 @@ else
29 echo -e " LXD_TEMPLATE is not configured.\n Note: If left unconfigured, we will attempt to get the LXD image from the ubuntu LXD image stream.\n Would you like to configure it now? [Y/n]"
30 read -s -N1 a
31 if [[ $a == "Y" || $a == "y" || -z $a ]]; then
32+ echo -e " NOTE: For the following, you must provide a valid URL beginning with http://,"
33+ echo -e " https://, or file://"
34 read -e -p " Enter the URL of your LXD Template File: " template
35 sudo sed -i "s,#LXD_TEMPLATE =.*,LXD_TEMPLATE = $template,g" /etc/xdg/canonical-certification.conf
36 templateurl=$(grep ^LXD_TEMPLATE /etc/xdg/canonical-certification.conf|awk '{print $3}')
37@@ -423,7 +427,7 @@ else
38 echo -e " $templateurl is not a valid url.\n Would you like to reconfigure it now? [Y/n]"
39 read -s -N1 a
40 if [[ $a == "Y" || $a == "y" || -z $a ]]; then
41- read -e -p " Enter the path of your LXD Template File: " template
42+ read -e -p " Enter the URL of your LXD Template File: " template
43 sudo sed -i "s,LXD_TEMPLATE =.*,LXD_TEMPLATE = $template,g" /etc/xdg/canonical-certification.conf
44 templateurl=$(grep ^LXD_TEMPLATE /etc/xdg/canonical-certification.conf|awk '{print $3}')
45 if curl --output /dev/null --silent --head -fail "$templateurl"; then
46@@ -431,7 +435,7 @@ else
47 pass
48 return 0
49 else
50- echo -e " We cannot get the LXD template image from $kvmurl.\n Marking as failed"
51+ echo -e " We cannot get the LXD template image from $templateurl.\n Marking as failed"
52 fail
53 return 0
54 fi
55@@ -452,6 +456,8 @@ if grep "^LXD_ROOTFS =" /etc/xdg/canonical-certification.conf >/dev/null; then
56 echo -e " $rootfsurl is a valid url.\n Continuing to use this rootfs file"
57 pass
58 else
59+ echo -e " NOTE: For the following, you must provide a valid URL beginning with http://,"
60+ echo -e " https://, or file://"
61 echo -e " $rootfsurl is not a valid url.\n Would you like to reconfigure it now? [Y/n]"
62 read -s -N1 a
63 if [[ $a == "Y" || $a == "y" || -z $a ]]; then
64@@ -477,6 +483,8 @@ else
65 echo -e " LXD_ROOTFS is not configured.\n Note: If left unconfigured, we will attempt to get the ROOTFS image from the ubuntu LXD image stream.\n Would you like to configure it now? [Y/n]"
66 read -s -N1 a
67 if [[ $a == "Y" || $a == "y" || -z $a ]]; then
68+ echo -e " NOTE: For the following, you must provide a valid URL beginning with http://,"
69+ echo -e " https://, or file://"
70 read -e -p " Enter the URL of your ROOTFS File: " rootfs
71 sudo sed -i "s,#LXD_ROOTFS =.*,LXD_ROOTFS = $rootfs,g" /etc/xdg/canonical-certification.conf
72 rootfsurl=$(grep ^LXD_ROOTFS /etc/xdg/canonical-certification.conf|awk '{print $3}')

Subscribers

People subscribed via source and target branches