Merge lp:~rodsmith/maas-cert-server/split-admin-login into lp:~hardware-certification/maas-cert-server/trunk

Proposed by Rod Smith
Status: Merged
Approved by: Jeff Lane 
Approved revision: 32
Merged at revision: 32
Proposed branch: lp:~rodsmith/maas-cert-server/split-admin-login
Merge into: lp:~hardware-certification/maas-cert-server/trunk
Diff against target: 49 lines (+15/-2)
2 files modified
debian/changelog (+7/-0)
usr/sbin/maniacs-setup (+8/-2)
To merge this branch: bzr merge lp:~rodsmith/maas-cert-server/split-admin-login
Reviewer Review Type Date Requested Status
Jeff Lane  Approve
Review via email: mp+267383@code.launchpad.net

Description of the change

Split MAAS login code into a tiny function and call it two places in the script, to ensure it's run when --update-point-releases is called.

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

Cool. Thanks for fixing that bug you pointed out.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-08-06 23:31:49 +0000
3+++ debian/changelog 2015-08-07 17:01:22 +0000
4@@ -1,3 +1,10 @@
5+maas-cert-server (0.2.6-0ppa1) trusty; urgency=medium
6+
7+ * Fixed bug 1482698, which prevented maniacs-setup
8+ --update-point-releases from working under some circumstances.
9+
10+ -- Rod Smith <rod.smith@canonical.com> Fri, 07 Aug 2015 12:55:43 -0400
11+
12 maas-cert-server (0.2.5-0ppa1) trusty; urgency=medium
13
14 * Updated maniacs-setup to pull down 14.04.3 point-release images
15
16=== modified file 'usr/sbin/maniacs-setup'
17--- usr/sbin/maniacs-setup 2015-08-06 23:31:49 +0000
18+++ usr/sbin/maniacs-setup 2015-08-07 17:01:22 +0000
19@@ -200,6 +200,12 @@
20 }
21
22
23+login_maas_admin() {
24+ local APIKEY=$(maas-region-admin apikey --username $DEFAULT_USER | tail -n1)
25+ maas login admin $MAAS_URL $APIKEY
26+}
27+
28+
29 setup_maas_admin() {
30 # Configure the MAAS admin user
31 # Sadly, there's no way to test if the user has been created already,
32@@ -225,8 +231,7 @@
33 done
34 echo "* Setting up the $DEFAULT_USER MAAS account using the supplied password"
35 maas-region-admin createadmin --username $DEFAULT_USER --email maas-admin@example.com --password="$password1" 2>/dev/null || true
36- APIKEY=$(maas-region-admin apikey --username $DEFAULT_USER | tail -n1)
37- maas login admin $MAAS_URL $APIKEY
38+ login_maas_admin
39 }
40
41
42@@ -595,6 +600,7 @@
43 echo "* imported."
44 echo "*"
45 get_yn "* Do you want to import the 12.04 point-release images, too" "N"
46+ login_maas_admin
47 if [ "$YN" = "Y" ] ; then
48 local versions=(14.04.3 14.04.2 14.04.1 14.04 12.04 12.04.1 12.04.2 12.04.3 12.04.4 12.04.5)
49 else

Subscribers

People subscribed via source and target branches

to status/vote changes: