Merge lp:~allenap/maas/1.2-remove-squashfs into lp:maas/1.2

Proposed by Gavin Panella
Status: Merged
Approved by: Gavin Panella
Approved revision: 1300
Merged at revision: 1300
Proposed branch: lp:~allenap/maas/1.2-remove-squashfs
Merge into: lp:maas/1.2
Diff against target: 425 lines (+3/-270)
11 files modified
contrib/maas-http.conf (+0/-6)
contrib/preseeds_v2/generic (+0/-9)
contrib/preseeds_v2/preseed_master (+0/-3)
etc/maas/import_pxe_files (+0/-1)
etc/maas/import_squashfs (+0/-6)
scripts/maas-import-pxe-files (+0/-27)
scripts/maas-import-squashfs (+0/-172)
setup.py (+1/-3)
src/maasserver/preseed.py (+1/-12)
src/maasserver/tests/test_preseed.py (+1/-28)
src/provisioningserver/tests/test_maas_import_pxe_files.py (+0/-3)
To merge this branch: bzr merge lp:~allenap/maas/1.2-remove-squashfs
Reviewer Review Type Date Requested Status
Raphaël Badin (community) Approve
Gavin Panella (community) Approve
Review via email: mp+134450@code.launchpad.net

Commit message

Remove all install-via-squashfs support.

Description of the change

Backport of lp:maas r1315.

To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) :
review: Approve
Revision history for this message
Raphaël Badin (rvb) wrote :

Thanks for doing this :).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'contrib/maas-http.conf'
--- contrib/maas-http.conf 2012-10-10 09:30:11 +0000
+++ contrib/maas-http.conf 2012-11-15 12:09:22 +0000
@@ -51,12 +51,6 @@
51 SetHandler None51 SetHandler None
52</Directory>52</Directory>
5353
54# Serve squashfs images
55Alias /MAAS/static/images/ /var/lib/maas/tftp/
56<Directory /var/lib/maas/tftp/>
57 SetHandler None
58</Directory>
59
60# Serve files from staticfiles.54# Serve files from staticfiles.
61Alias /MAAS/static/ /usr/share/maas/web/static/55Alias /MAAS/static/ /usr/share/maas/web/static/
62<Directory /usr/share/maas/web/static/>56<Directory /usr/share/maas/web/static/>
6357
=== modified file 'contrib/preseeds_v2/generic'
--- contrib/preseeds_v2/generic 2012-10-05 02:18:39 +0000
+++ contrib/preseeds_v2/generic 2012-11-15 12:09:22 +0000
@@ -1,14 +1,5 @@
1{{inherit "preseed_master"}}1{{inherit "preseed_master"}}
22
3{{def squashfs_image}}
4{{if node.distro_series in {'quantal'} and node.architecture in {'i386/generic', 'amd64/generic'} and use_squashfs is True }}
5d-i preseed/early_command string anna-install live-installer
6d-i live-installer/enable boolean true
7d-i live-installer/mode select normal
8d-i live-installer/net-image string http://{{server_host}}/MAAS/static/images/{{node.architecture}}/{{node.distro_series}}/filesystem/filesystem.squashfs
9{{endif}}
10{{enddef}}
11
12{{def proxy}}3{{def proxy}}
13d-i mirror/country string manual4d-i mirror/country string manual
14{{if node.architecture in {'i386/generic', 'amd64/generic'} }}5{{if node.architecture in {'i386/generic', 'amd64/generic'} }}
156
=== modified file 'contrib/preseeds_v2/preseed_master'
--- contrib/preseeds_v2/preseed_master 2012-10-02 19:08:05 +0000
+++ contrib/preseeds_v2/preseed_master 2012-11-15 12:09:22 +0000
@@ -3,9 +3,6 @@
3# * Cloud-init for bare-metal3# * Cloud-init for bare-metal
4# * Cloud-init preseed data4# * Cloud-init preseed data
55
6# Squashfs Installation
7{{self.squashfs_image}}
8
9# Locale6# Locale
10d-i debian-installer/locale string en_US.UTF-87d-i debian-installer/locale string en_US.UTF-8
118
129
=== modified file 'etc/maas/import_pxe_files'
--- etc/maas/import_pxe_files 2012-10-02 17:00:19 +0000
+++ etc/maas/import_pxe_files 2012-11-15 12:09:22 +0000
@@ -17,4 +17,3 @@
17#ARCHES="amd64/generic i386/generic armhf/highbank"17#ARCHES="amd64/generic i386/generic armhf/highbank"
18#LOCALE="en_US"18#LOCALE="en_US"
19#IMPORT_EPHEMERALS=119#IMPORT_EPHEMERALS=1
20#IMPORT_SQUASHFS=1
2120
=== removed file 'etc/maas/import_squashfs'
--- etc/maas/import_squashfs 2012-09-29 03:12:23 +0000
+++ etc/maas/import_squashfs 1970-01-01 00:00:00 +0000
@@ -1,6 +0,0 @@
1## get default settings from import_pxe_files
2[ ! -f /etc/maas/import_pxe_files ] || . /etc/maas/import_pxe_files
3
4#SQUASHFS_ARCHIVE="https://cdimage.ubuntu.com"
5#RELEASES="quantal"
6#ARCHES="amd64 i386"
70
=== modified file 'scripts/maas-import-pxe-files'
--- scripts/maas-import-pxe-files 2012-11-02 11:29:40 +0000
+++ scripts/maas-import-pxe-files 2012-11-15 12:09:22 +0000
@@ -41,14 +41,6 @@
41# directory. A wget command line will work here, but curl will do as well.41# directory. A wget command line will work here, but curl will do as well.
42DOWNLOAD=${DOWNLOAD:-wget --no-verbose}42DOWNLOAD=${DOWNLOAD:-wget --no-verbose}
4343
44# Whether to download squashfs images as well: "1" for yes, "0" for no.
45# Default is yes.
46IMPORT_SQUASHFS=${IMPORT_SQUASHFS:-1}
47
48# Whether to download squashfs images as well: "1" for yes, "0" for no.
49# Default is yes.
50IMPORT_SQUASHFS=${IMPORT_SQUASHFS:-1}
51
52# Whether to download ephemeral images as well: "1" for yes, "0" for no.44# Whether to download ephemeral images as well: "1" for yes, "0" for no.
53# Default is yes.45# Default is yes.
54IMPORT_EPHEMERALS=${IMPORT_EPHEMERALS:-1}46IMPORT_EPHEMERALS=${IMPORT_EPHEMERALS:-1}
@@ -197,24 +189,6 @@
197}189}
198190
199191
200# Download and install the squashfs root images.
201import_squashfs_images() {
202 if test "$IMPORT_SQUASHFS" != "0"
203 then
204 maas-import-squashfs
205 fi
206}
207
208
209# Download and install the squashfs root images.
210import_squashfs_images() {
211 if test "$IMPORT_SQUASHFS" != "0"
212 then
213 maas-import-squashfs
214 fi
215}
216
217
218# Download and install the ephemeral images.192# Download and install the ephemeral images.
219import_ephemeral_images() {193import_ephemeral_images() {
220 if test "$IMPORT_EPHEMERALS" != "0"194 if test "$IMPORT_EPHEMERALS" != "0"
@@ -231,7 +205,6 @@
231205
232 update_pre_boot_loader206 update_pre_boot_loader
233 import_install_images207 import_install_images
234 import_squashfs_images
235 import_ephemeral_images208 import_ephemeral_images
236}209}
237210
238211
=== removed file 'scripts/maas-import-squashfs'
--- scripts/maas-import-squashfs 2012-10-02 19:08:05 +0000
+++ scripts/maas-import-squashfs 1970-01-01 00:00:00 +0000
@@ -1,172 +0,0 @@
1#!/bin/bash
2#
3# maas-import-squashfs - sync and import squashfs images
4#
5# Copyright (C) 2012 Canonical
6#
7# Authors:
8# Andres Rodriguez <andres.rodriguez@canonical.com>
9#
10# This program is free software: you can redistribute it and/or modify
11# it under the terms of the GNU Affero General Public License as
12# published by the Free Software Foundation, version 3 of the License.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU Affero General Public License for more details.
18#
19# You should have received a copy of the GNU Affero General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.
21
22# Exit immediately if a command exits with a non-zero status.
23set -o errexit
24# Treat unset variables as an error when substituting.
25set -o nounset
26
27# Load settings if available.
28settings="/etc/maas/import_squashfs"
29[ -r $settings ] && . $settings
30local_settings="$(pwd)/$settings"
31[ -r $local_settings ] && . $local_settings
32
33# Download locations for Ubuntu releases.
34#http://cdimage.ubuntu.com/ubuntu-server/daily/current/
35SQUASHFS_ARCHIVE=${ARCHIVE:-http://cdimage.ubuntu.com/}
36
37# Ubuntu releases that are to be downloaded.
38SUPPORTED_RELEASES=""
39for supported in $(distro-info --supported)
40do
41 if [ $(expr "$supported" \>= "quantal") -eq 1 ]; then
42 SUPPORTED_RELEASES="${SUPPORTED_RELEASES:-}${supported} "
43 fi
44done
45
46EFFECTIVE_RELEASES=""
47if [ -z "$RELEASES" ]; then
48 RELEASES=${RELEASES:-$SUPPORTED_RELEASES}
49else
50 for release in $RELEASES
51 do
52 [[ "$SUPPORTED_RELEASES" =~ "${release}" ]] && EFFECTIVE_RELEASES="${EFFECTIVE_RELEASES:-}${release} "
53 done
54 RELEASES="$EFFECTIVE_RELEASES"
55fi
56
57# The current Ubuntu release.
58STABLE_RELEASE=$(distro-info --stable)
59
60# Supported architectures.
61ARCHES=${ARCHES:-amd64/generic i386/generic}
62
63# Command line to download a resource at a given URL into the current
64# directory. A wget command line will work here, but curl will do as well.
65DOWNLOAD=${DOWNLOAD:-wget --no-verbose}
66
67# Whether to download squashfs images as well: "1" for yes, "0" for no.
68# Default is yes.
69IMPORT_SQUASHFS=${IMPORT_SQUASHFS:-1}
70
71# Put together a full URL for where the installer files for architecture $1
72# and release $2 can be downloaded.
73compose_installer_download_url() {
74 local arch=$1 release=$2
75
76 case $arch in
77 amd64/*|i386/*)
78 local installer_url="$SQUASHFS_ARCHIVE/ubuntu-server/daily/current"
79 echo $installer_url
80 ;;
81 *)
82 echo "Unknown architecture: $arch" >&2
83 exit 1
84 ;;
85 esac
86}
87
88# Return a list of files for architecture $1 and release $2 that need to be
89# downloaded
90compose_installer_download_files() {
91 local arch=$1 release=$2
92
93 case $arch in
94 amd64/*|i386/*)
95 echo "$release-server-${arch%%/*}.squashfs"
96 ;;
97 *)
98 echo "Unknown architecture: $arch" >&2
99 exit 1
100 ;;
101 esac
102}
103
104# Rename downloaded files for architecture $1 and release $2 into the form that
105# MAAS expects them
106rename_installer_download_files() {
107 local arch=$1 release=$2
108
109 case $arch in
110 amd64/*|i386/*)
111 mv $release-server-${arch%%/*}.squashfs filesystem.squashfs
112 ;;
113 *)
114 echo "Unknown architecture: $arch" >&2
115 exit 1
116 ;;
117 esac
118}
119
120# Download kernel/initrd for installing Ubuntu release $2 for
121# architecture $1 and install it into the TFTP directory hierarchy.
122update_install_files() {
123 local arch=$1 release=$2
124 local files=$(compose_installer_download_files $arch $release)
125 local url=$(compose_installer_download_url $arch $release)
126 local file
127
128 mkdir "install"
129 pushd "install" >/dev/null
130 for file in $files
131 do
132 $DOWNLOAD $url/$file
133 done
134 rename_installer_download_files $arch $release
135 popd >/dev/null
136
137 maas-provision install-pxe-image \
138 --arch="${arch%%/*}" --subarch="${arch#*/}" \
139 --release=$release --purpose="filesystem" \
140 --image="install"
141}
142
143
144# Download and install the "install" images.
145import_install_images() {
146 local arch release DOWNLOAD_DIR
147
148 DOWNLOAD_DIR=$(mktemp -d)
149 echo "Downloading to temporary location $DOWNLOAD_DIR."
150 pushd -- $DOWNLOAD_DIR
151
152 for arch in $ARCHES
153 do
154 for release in $RELEASES
155 do
156 update_install_files $arch $release
157 done
158 done
159
160 popd
161 rm -rf -- $DOWNLOAD_DIR
162}
163
164
165main() {
166 # All files we create here are public. The TFTP user will need to be
167 # able to read them.
168 umask a+r
169 import_install_images
170}
171
172main
1730
=== modified file 'setup.py'
--- setup.py 2012-10-25 08:01:18 +0000
+++ setup.py 2012-11-15 12:09:22 +0000
@@ -58,7 +58,6 @@
58 'etc/maas_cluster.conf',58 'etc/maas_cluster.conf',
59 'etc/txlongpoll.yaml',59 'etc/txlongpoll.yaml',
60 'contrib/maas_local_celeryconfig.py',60 'contrib/maas_local_celeryconfig.py',
61 'etc/maas/import_squashfs',
62 'contrib/maas_local_celeryconfig_cluster.py',61 'contrib/maas_local_celeryconfig_cluster.py',
63 'etc/maas/import_ephemerals',62 'etc/maas/import_ephemerals',
64 'etc/maas/import_pxe_files',63 'etc/maas/import_pxe_files',
@@ -77,8 +76,7 @@
77 'contrib/preseeds_v2/enlist_userdata',76 'contrib/preseeds_v2/enlist_userdata',
78 'contrib/preseeds_v2/preseed_master']),77 'contrib/preseeds_v2/preseed_master']),
79 ('/usr/sbin',78 ('/usr/sbin',
80 ['scripts/maas-import-squashfs',79 ['scripts/maas-import-ephemerals',
81 'scripts/maas-import-ephemerals',
82 'scripts/maas-import-pxe-files']),80 'scripts/maas-import-pxe-files']),
83 ],81 ],
8482
8583
=== modified file 'src/maasserver/preseed.py'
--- src/maasserver/preseed.py 2012-10-30 10:25:24 +0000
+++ src/maasserver/preseed.py 2012-11-15 12:09:22 +0000
@@ -28,10 +28,7 @@
28 NODE_STATUS,28 NODE_STATUS,
29 PRESEED_TYPE,29 PRESEED_TYPE,
30 )30 )
31from maasserver.models import (31from maasserver.models import Config
32 BootImage,
33 Config,
34 )
35from maasserver.server_address import get_maas_facing_server_host32from maasserver.server_address import get_maas_facing_server_host
36from maasserver.utils import absolute_reverse33from maasserver.utils import absolute_reverse
37import tempita34import tempita
@@ -231,20 +228,12 @@
231 'preseed_data': compose_preseed(node),228 'preseed_data': compose_preseed(node),
232 'node_disable_pxe_url': node_disable_pxe_url,229 'node_disable_pxe_url': node_disable_pxe_url,
233 'node_disable_pxe_data': node_disable_pxe_data,230 'node_disable_pxe_data': node_disable_pxe_data,
234 'use_squashfs': is_squashfs_image_present(node),
235 }231 }
236 context.update(node_context)232 context.update(node_context)
237233
238 return context234 return context
239235
240236
241def is_squashfs_image_present(node):
242 """Whether or not the SquashFS image can be used during installation."""
243 arch, subarch = node.architecture.split("/")
244 return BootImage.objects.have_image(
245 node.nodegroup, arch, subarch, node.get_distro_series(), "filesystem")
246
247
248def render_preseed(node, prefix, release=''):237def render_preseed(node, prefix, release=''):
249 """Find and load a `PreseedTemplate` for the given node.238 """Find and load a `PreseedTemplate` for the given node.
250239
251240
=== modified file 'src/maasserver/tests/test_preseed.py'
--- src/maasserver/tests/test_preseed.py 2012-10-30 10:25:24 +0000
+++ src/maasserver/tests/test_preseed.py 2012-11-15 12:09:22 +0000
@@ -31,7 +31,6 @@
31 get_preseed_context,31 get_preseed_context,
32 get_preseed_filenames,32 get_preseed_filenames,
33 get_preseed_template,33 get_preseed_template,
34 is_squashfs_image_present,
35 load_preseed_template,34 load_preseed_template,
36 PreseedTemplate,35 PreseedTemplate,
37 render_preseed,36 render_preseed,
@@ -297,8 +296,7 @@
297 self.assertItemsEqual(296 self.assertItemsEqual(
298 ['node', 'release', 'metadata_enlist_url',297 ['node', 'release', 'metadata_enlist_url',
299 'server_host', 'server_url', 'preseed_data',298 'server_host', 'server_url', 'preseed_data',
300 'node_disable_pxe_url', 'node_disable_pxe_data',299 'node_disable_pxe_url', 'node_disable_pxe_data'],
301 'use_squashfs'],
302 context)300 context)
303301
304 def test_get_preseed_context_if_node_None(self):302 def test_get_preseed_context_if_node_None(self):
@@ -312,31 +310,6 @@
312 context)310 context)
313311
314312
315class TestSquashFSAvailable(TestCase):
316 """Tests for `is_squashfs_image_present`."""
317
318 # Scenario defaults.
319 arch = "i386"
320 subarch = "generic"
321 series = "quantal"
322 purpose = "filesystem"
323
324 scenarios = (
325 ("mismatch-arch", dict(arch="amd64", present=False)),
326 ("mismatch-subarch", dict(subarch="special", present=False)),
327 ("mismatch-series", dict(series="precise", present=False)),
328 ("mismatch-purpose", dict(purpose="moonraking", present=False)),
329 ("match", dict(present=True)),
330 )
331
332 def test_squashfs_available(self):
333 node = factory.make_node(
334 architecture="i386/generic", distro_series="quantal")
335 BootImage.objects.register_image(
336 node.nodegroup, self.arch, self.subarch, self.series, self.purpose)
337 self.assertEqual(self.present, is_squashfs_image_present(node))
338
339
340class TestPreseedTemplate(TestCase):313class TestPreseedTemplate(TestCase):
341 """Tests for class:`PreseedTemplate`."""314 """Tests for class:`PreseedTemplate`."""
342315
343316
=== modified file 'src/provisioningserver/tests/test_maas_import_pxe_files.py'
--- src/provisioningserver/tests/test_maas_import_pxe_files.py 2012-11-02 11:29:40 +0000
+++ src/provisioningserver/tests/test_maas_import_pxe_files.py 2012-11-15 12:09:22 +0000
@@ -161,9 +161,6 @@
161 # Suppress running of maas-import-ephemerals. It gets too161 # Suppress running of maas-import-ephemerals. It gets too
162 # intimate with the system to test here.162 # intimate with the system to test here.
163 'IMPORT_EPHEMERALS': '0',163 'IMPORT_EPHEMERALS': '0',
164 # Suppress running of maas-import-squashfs. It gets too
165 # intimate with the system to test here.
166 'IMPORT_SQUASHFS': '0',
167 }164 }
168 env.update(self.config_fixture.environ)165 env.update(self.config_fixture.environ)
169 if arch is not None:166 if arch is not None:

Subscribers

People subscribed via source and target branches

to status/vote changes: