Merge lp:~rodsmith/maas-cert-server/fix-i386-detection into lp:~hardware-certification/maas-cert-server/trunk

Proposed by Rod Smith
Status: Merged
Approved by: Jeff Lane 
Approved revision: 67
Merged at revision: 68
Proposed branch: lp:~rodsmith/maas-cert-server/fix-i386-detection
Merge into: lp:~hardware-certification/maas-cert-server/trunk
Diff against target: 71 lines (+37/-2)
2 files modified
debian/changelog (+7/-0)
usr/sbin/maniacs-setup (+30/-2)
To merge this branch: bzr merge lp:~rodsmith/maas-cert-server/fix-i386-detection
Reviewer Review Type Date Requested Status
Jeff Lane  Approve
Review via email: mp+311087@code.launchpad.net

Description of the change

This is not-quite-a-fix for bug #1641971 (using maniacs-setup fails to import i386 images by default under MAAS 2.1, resulting in error messages). Instead of addressing the issue head-on, this version returns the script to the behavior it had in the past (with MAAS 2.0): It imports i386 custom images if and only if standard MAAS i386 images already exist on the server. The error messages seem to be a result of pxelinux being split out into its own unique image in MAAS 2.1, which was not the case with MAAS 2.0. This results in the need for a more complex test to see if an i386 image is loaded. Note that, because this doesn't precisely address the issues in bug #1641971, I have not marked this as a fix for that bug.

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

Cool.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2016-10-17 17:49:31 +0000
+++ debian/changelog 2016-11-16 22:07:52 +0000
@@ -1,3 +1,10 @@
1maas-cert-server (0.2.26-0ppa1) xenial; urgency=medium
2
3 * Fixed detection of i386 images for custom-image download
4 feature under MAAS 2.1.
5
6 -- Rod Smith <rod.smith@canonical.com> Wed, 16 Nov 2016 16:57:33 -0500
7
1maas-cert-server (0.2.25-0ppa1) xenial; urgency=medium8maas-cert-server (0.2.25-0ppa1) xenial; urgency=medium
29
3 * Fixed typo in prompt in maniacs-setup: "virtualization" was spelled10 * Fixed typo in prompt in maniacs-setup: "virtualization" was spelled
411
=== modified file 'usr/sbin/maniacs-setup'
--- usr/sbin/maniacs-setup 2016-09-13 18:57:24 +0000
+++ usr/sbin/maniacs-setup 2016-11-16 22:07:52 +0000
@@ -861,6 +861,34 @@
861}861}
862862
863863
864# Determine if any i386 images are loaded on the MAAS server.
865# Sets $is_i386 to "N" if no i386 images are found, "Y" if they are.
866is_i386_loaded() {
867 is_i386="N"
868 local resources=`maas admin boot-resources read`
869 # Look for evidence of i386 installation. Note that the below can produce
870 # false positives, so we do more shortly....
871 local maybe_i386=`echo $resources | jshon -a -e architecture | grep i386`
872 if [ ! -z "$maybe_i386" ] ; then
873 local num_entries=`echo $resources | jshon -l`
874 let last_entry=$num_entries-1
875 for entry in `seq 0 $last_entry`; do
876 one_entry=`echo $resources | jshon -e $entry`
877 local found_possible_i386=`echo $one_entry | grep i386`
878 if [ ! -z "$found_possible_i386" ] ; then
879 local is_pxelinux=`echo "$one_entry" | jshon -e name | grep pxelinux`
880 # False positive can result from pxelinux entry, which is why
881 # we filter it out. AFAIK, any other "i386" in "name" field is
882 # a legitimate i386 image.
883 if [ -z "$is_pxelinux" ] ; then
884 is_i386="Y"
885 fi
886 fi
887 done
888 fi
889} # is_i386_loaded()
890
891
864setup_point_releases() {892setup_point_releases() {
865 echo893 echo
866 echo "***************************************************************************"894 echo "***************************************************************************"
@@ -872,7 +900,7 @@
872 local versions=`wget -O - $FIXED_POINT_URL 2> /dev/null | grep ubuntu.*gz | sed "s/.*ubuntu-//" | sed "s/-server-.*//" | uniq | sort -r`900 local versions=`wget -O - $FIXED_POINT_URL 2> /dev/null | grep ubuntu.*gz | sed "s/.*ubuntu-//" | sed "s/-server-.*//" | uniq | sort -r`
873 local old_series=""901 local old_series=""
874 local default_release=""902 local default_release=""
875 local is_i386=`maas admin boot-resources read | grep i386`903 is_i386_loaded
876 for release in ${versions[@]}; do904 for release in ${versions[@]}; do
877 local series=`echo $release | cut -b 1-5`905 local series=`echo $release | cut -b 1-5`
878 if [ "$old_series" != "$series" ] ; then906 if [ "$old_series" != "$series" ] ; then
@@ -897,7 +925,7 @@
897 default_release=u"$release"_amd64925 default_release=u"$release"_amd64
898 fi926 fi
899 load_point_release $release amd64 "$default_yn"927 load_point_release $release amd64 "$default_yn"
900 if [ ! -z "$is_i386" ] ; then928 if [ "$is_i386" = "Y" ] ; then
901 load_point_release $release i386 "$default_yn"929 load_point_release $release i386 "$default_yn"
902 fi930 fi
903 fi931 fi

Subscribers

People subscribed via source and target branches

to status/vote changes: