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: no longer in the source branch.
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
1=== modified file 'contrib/maas-http.conf'
2--- contrib/maas-http.conf 2012-10-10 09:30:11 +0000
3+++ contrib/maas-http.conf 2012-11-15 12:09:22 +0000
4@@ -51,12 +51,6 @@
5 SetHandler None
6 </Directory>
7
8-# Serve squashfs images
9-Alias /MAAS/static/images/ /var/lib/maas/tftp/
10-<Directory /var/lib/maas/tftp/>
11- SetHandler None
12-</Directory>
13-
14 # Serve files from staticfiles.
15 Alias /MAAS/static/ /usr/share/maas/web/static/
16 <Directory /usr/share/maas/web/static/>
17
18=== modified file 'contrib/preseeds_v2/generic'
19--- contrib/preseeds_v2/generic 2012-10-05 02:18:39 +0000
20+++ contrib/preseeds_v2/generic 2012-11-15 12:09:22 +0000
21@@ -1,14 +1,5 @@
22 {{inherit "preseed_master"}}
23
24-{{def squashfs_image}}
25-{{if node.distro_series in {'quantal'} and node.architecture in {'i386/generic', 'amd64/generic'} and use_squashfs is True }}
26-d-i preseed/early_command string anna-install live-installer
27-d-i live-installer/enable boolean true
28-d-i live-installer/mode select normal
29-d-i live-installer/net-image string http://{{server_host}}/MAAS/static/images/{{node.architecture}}/{{node.distro_series}}/filesystem/filesystem.squashfs
30-{{endif}}
31-{{enddef}}
32-
33 {{def proxy}}
34 d-i mirror/country string manual
35 {{if node.architecture in {'i386/generic', 'amd64/generic'} }}
36
37=== modified file 'contrib/preseeds_v2/preseed_master'
38--- contrib/preseeds_v2/preseed_master 2012-10-02 19:08:05 +0000
39+++ contrib/preseeds_v2/preseed_master 2012-11-15 12:09:22 +0000
40@@ -3,9 +3,6 @@
41 # * Cloud-init for bare-metal
42 # * Cloud-init preseed data
43
44-# Squashfs Installation
45-{{self.squashfs_image}}
46-
47 # Locale
48 d-i debian-installer/locale string en_US.UTF-8
49
50
51=== modified file 'etc/maas/import_pxe_files'
52--- etc/maas/import_pxe_files 2012-10-02 17:00:19 +0000
53+++ etc/maas/import_pxe_files 2012-11-15 12:09:22 +0000
54@@ -17,4 +17,3 @@
55 #ARCHES="amd64/generic i386/generic armhf/highbank"
56 #LOCALE="en_US"
57 #IMPORT_EPHEMERALS=1
58-#IMPORT_SQUASHFS=1
59
60=== removed file 'etc/maas/import_squashfs'
61--- etc/maas/import_squashfs 2012-09-29 03:12:23 +0000
62+++ etc/maas/import_squashfs 1970-01-01 00:00:00 +0000
63@@ -1,6 +0,0 @@
64-## get default settings from import_pxe_files
65-[ ! -f /etc/maas/import_pxe_files ] || . /etc/maas/import_pxe_files
66-
67-#SQUASHFS_ARCHIVE="https://cdimage.ubuntu.com"
68-#RELEASES="quantal"
69-#ARCHES="amd64 i386"
70
71=== modified file 'scripts/maas-import-pxe-files'
72--- scripts/maas-import-pxe-files 2012-11-02 11:29:40 +0000
73+++ scripts/maas-import-pxe-files 2012-11-15 12:09:22 +0000
74@@ -41,14 +41,6 @@
75 # directory. A wget command line will work here, but curl will do as well.
76 DOWNLOAD=${DOWNLOAD:-wget --no-verbose}
77
78-# Whether to download squashfs images as well: "1" for yes, "0" for no.
79-# Default is yes.
80-IMPORT_SQUASHFS=${IMPORT_SQUASHFS:-1}
81-
82-# Whether to download squashfs images as well: "1" for yes, "0" for no.
83-# Default is yes.
84-IMPORT_SQUASHFS=${IMPORT_SQUASHFS:-1}
85-
86 # Whether to download ephemeral images as well: "1" for yes, "0" for no.
87 # Default is yes.
88 IMPORT_EPHEMERALS=${IMPORT_EPHEMERALS:-1}
89@@ -197,24 +189,6 @@
90 }
91
92
93-# Download and install the squashfs root images.
94-import_squashfs_images() {
95- if test "$IMPORT_SQUASHFS" != "0"
96- then
97- maas-import-squashfs
98- fi
99-}
100-
101-
102-# Download and install the squashfs root images.
103-import_squashfs_images() {
104- if test "$IMPORT_SQUASHFS" != "0"
105- then
106- maas-import-squashfs
107- fi
108-}
109-
110-
111 # Download and install the ephemeral images.
112 import_ephemeral_images() {
113 if test "$IMPORT_EPHEMERALS" != "0"
114@@ -231,7 +205,6 @@
115
116 update_pre_boot_loader
117 import_install_images
118- import_squashfs_images
119 import_ephemeral_images
120 }
121
122
123=== removed file 'scripts/maas-import-squashfs'
124--- scripts/maas-import-squashfs 2012-10-02 19:08:05 +0000
125+++ scripts/maas-import-squashfs 1970-01-01 00:00:00 +0000
126@@ -1,172 +0,0 @@
127-#!/bin/bash
128-#
129-# maas-import-squashfs - sync and import squashfs images
130-#
131-# Copyright (C) 2012 Canonical
132-#
133-# Authors:
134-# Andres Rodriguez <andres.rodriguez@canonical.com>
135-#
136-# This program is free software: you can redistribute it and/or modify
137-# it under the terms of the GNU Affero General Public License as
138-# published by the Free Software Foundation, version 3 of the License.
139-#
140-# This program is distributed in the hope that it will be useful,
141-# but WITHOUT ANY WARRANTY; without even the implied warranty of
142-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
143-# GNU Affero General Public License for more details.
144-#
145-# You should have received a copy of the GNU Affero General Public License
146-# along with this program. If not, see <http://www.gnu.org/licenses/>.
147-
148-# Exit immediately if a command exits with a non-zero status.
149-set -o errexit
150-# Treat unset variables as an error when substituting.
151-set -o nounset
152-
153-# Load settings if available.
154-settings="/etc/maas/import_squashfs"
155-[ -r $settings ] && . $settings
156-local_settings="$(pwd)/$settings"
157-[ -r $local_settings ] && . $local_settings
158-
159-# Download locations for Ubuntu releases.
160-#http://cdimage.ubuntu.com/ubuntu-server/daily/current/
161-SQUASHFS_ARCHIVE=${ARCHIVE:-http://cdimage.ubuntu.com/}
162-
163-# Ubuntu releases that are to be downloaded.
164-SUPPORTED_RELEASES=""
165-for supported in $(distro-info --supported)
166-do
167- if [ $(expr "$supported" \>= "quantal") -eq 1 ]; then
168- SUPPORTED_RELEASES="${SUPPORTED_RELEASES:-}${supported} "
169- fi
170-done
171-
172-EFFECTIVE_RELEASES=""
173-if [ -z "$RELEASES" ]; then
174- RELEASES=${RELEASES:-$SUPPORTED_RELEASES}
175-else
176- for release in $RELEASES
177- do
178- [[ "$SUPPORTED_RELEASES" =~ "${release}" ]] && EFFECTIVE_RELEASES="${EFFECTIVE_RELEASES:-}${release} "
179- done
180- RELEASES="$EFFECTIVE_RELEASES"
181-fi
182-
183-# The current Ubuntu release.
184-STABLE_RELEASE=$(distro-info --stable)
185-
186-# Supported architectures.
187-ARCHES=${ARCHES:-amd64/generic i386/generic}
188-
189-# Command line to download a resource at a given URL into the current
190-# directory. A wget command line will work here, but curl will do as well.
191-DOWNLOAD=${DOWNLOAD:-wget --no-verbose}
192-
193-# Whether to download squashfs images as well: "1" for yes, "0" for no.
194-# Default is yes.
195-IMPORT_SQUASHFS=${IMPORT_SQUASHFS:-1}
196-
197-# Put together a full URL for where the installer files for architecture $1
198-# and release $2 can be downloaded.
199-compose_installer_download_url() {
200- local arch=$1 release=$2
201-
202- case $arch in
203- amd64/*|i386/*)
204- local installer_url="$SQUASHFS_ARCHIVE/ubuntu-server/daily/current"
205- echo $installer_url
206- ;;
207- *)
208- echo "Unknown architecture: $arch" >&2
209- exit 1
210- ;;
211- esac
212-}
213-
214-# Return a list of files for architecture $1 and release $2 that need to be
215-# downloaded
216-compose_installer_download_files() {
217- local arch=$1 release=$2
218-
219- case $arch in
220- amd64/*|i386/*)
221- echo "$release-server-${arch%%/*}.squashfs"
222- ;;
223- *)
224- echo "Unknown architecture: $arch" >&2
225- exit 1
226- ;;
227- esac
228-}
229-
230-# Rename downloaded files for architecture $1 and release $2 into the form that
231-# MAAS expects them
232-rename_installer_download_files() {
233- local arch=$1 release=$2
234-
235- case $arch in
236- amd64/*|i386/*)
237- mv $release-server-${arch%%/*}.squashfs filesystem.squashfs
238- ;;
239- *)
240- echo "Unknown architecture: $arch" >&2
241- exit 1
242- ;;
243- esac
244-}
245-
246-# Download kernel/initrd for installing Ubuntu release $2 for
247-# architecture $1 and install it into the TFTP directory hierarchy.
248-update_install_files() {
249- local arch=$1 release=$2
250- local files=$(compose_installer_download_files $arch $release)
251- local url=$(compose_installer_download_url $arch $release)
252- local file
253-
254- mkdir "install"
255- pushd "install" >/dev/null
256- for file in $files
257- do
258- $DOWNLOAD $url/$file
259- done
260- rename_installer_download_files $arch $release
261- popd >/dev/null
262-
263- maas-provision install-pxe-image \
264- --arch="${arch%%/*}" --subarch="${arch#*/}" \
265- --release=$release --purpose="filesystem" \
266- --image="install"
267-}
268-
269-
270-# Download and install the "install" images.
271-import_install_images() {
272- local arch release DOWNLOAD_DIR
273-
274- DOWNLOAD_DIR=$(mktemp -d)
275- echo "Downloading to temporary location $DOWNLOAD_DIR."
276- pushd -- $DOWNLOAD_DIR
277-
278- for arch in $ARCHES
279- do
280- for release in $RELEASES
281- do
282- update_install_files $arch $release
283- done
284- done
285-
286- popd
287- rm -rf -- $DOWNLOAD_DIR
288-}
289-
290-
291-main() {
292- # All files we create here are public. The TFTP user will need to be
293- # able to read them.
294- umask a+r
295- import_install_images
296-}
297-
298-main
299
300=== modified file 'setup.py'
301--- setup.py 2012-10-25 08:01:18 +0000
302+++ setup.py 2012-11-15 12:09:22 +0000
303@@ -58,7 +58,6 @@
304 'etc/maas_cluster.conf',
305 'etc/txlongpoll.yaml',
306 'contrib/maas_local_celeryconfig.py',
307- 'etc/maas/import_squashfs',
308 'contrib/maas_local_celeryconfig_cluster.py',
309 'etc/maas/import_ephemerals',
310 'etc/maas/import_pxe_files',
311@@ -77,8 +76,7 @@
312 'contrib/preseeds_v2/enlist_userdata',
313 'contrib/preseeds_v2/preseed_master']),
314 ('/usr/sbin',
315- ['scripts/maas-import-squashfs',
316- 'scripts/maas-import-ephemerals',
317+ ['scripts/maas-import-ephemerals',
318 'scripts/maas-import-pxe-files']),
319 ],
320
321
322=== modified file 'src/maasserver/preseed.py'
323--- src/maasserver/preseed.py 2012-10-30 10:25:24 +0000
324+++ src/maasserver/preseed.py 2012-11-15 12:09:22 +0000
325@@ -28,10 +28,7 @@
326 NODE_STATUS,
327 PRESEED_TYPE,
328 )
329-from maasserver.models import (
330- BootImage,
331- Config,
332- )
333+from maasserver.models import Config
334 from maasserver.server_address import get_maas_facing_server_host
335 from maasserver.utils import absolute_reverse
336 import tempita
337@@ -231,20 +228,12 @@
338 'preseed_data': compose_preseed(node),
339 'node_disable_pxe_url': node_disable_pxe_url,
340 'node_disable_pxe_data': node_disable_pxe_data,
341- 'use_squashfs': is_squashfs_image_present(node),
342 }
343 context.update(node_context)
344
345 return context
346
347
348-def is_squashfs_image_present(node):
349- """Whether or not the SquashFS image can be used during installation."""
350- arch, subarch = node.architecture.split("/")
351- return BootImage.objects.have_image(
352- node.nodegroup, arch, subarch, node.get_distro_series(), "filesystem")
353-
354-
355 def render_preseed(node, prefix, release=''):
356 """Find and load a `PreseedTemplate` for the given node.
357
358
359=== modified file 'src/maasserver/tests/test_preseed.py'
360--- src/maasserver/tests/test_preseed.py 2012-10-30 10:25:24 +0000
361+++ src/maasserver/tests/test_preseed.py 2012-11-15 12:09:22 +0000
362@@ -31,7 +31,6 @@
363 get_preseed_context,
364 get_preseed_filenames,
365 get_preseed_template,
366- is_squashfs_image_present,
367 load_preseed_template,
368 PreseedTemplate,
369 render_preseed,
370@@ -297,8 +296,7 @@
371 self.assertItemsEqual(
372 ['node', 'release', 'metadata_enlist_url',
373 'server_host', 'server_url', 'preseed_data',
374- 'node_disable_pxe_url', 'node_disable_pxe_data',
375- 'use_squashfs'],
376+ 'node_disable_pxe_url', 'node_disable_pxe_data'],
377 context)
378
379 def test_get_preseed_context_if_node_None(self):
380@@ -312,31 +310,6 @@
381 context)
382
383
384-class TestSquashFSAvailable(TestCase):
385- """Tests for `is_squashfs_image_present`."""
386-
387- # Scenario defaults.
388- arch = "i386"
389- subarch = "generic"
390- series = "quantal"
391- purpose = "filesystem"
392-
393- scenarios = (
394- ("mismatch-arch", dict(arch="amd64", present=False)),
395- ("mismatch-subarch", dict(subarch="special", present=False)),
396- ("mismatch-series", dict(series="precise", present=False)),
397- ("mismatch-purpose", dict(purpose="moonraking", present=False)),
398- ("match", dict(present=True)),
399- )
400-
401- def test_squashfs_available(self):
402- node = factory.make_node(
403- architecture="i386/generic", distro_series="quantal")
404- BootImage.objects.register_image(
405- node.nodegroup, self.arch, self.subarch, self.series, self.purpose)
406- self.assertEqual(self.present, is_squashfs_image_present(node))
407-
408-
409 class TestPreseedTemplate(TestCase):
410 """Tests for class:`PreseedTemplate`."""
411
412
413=== modified file 'src/provisioningserver/tests/test_maas_import_pxe_files.py'
414--- src/provisioningserver/tests/test_maas_import_pxe_files.py 2012-11-02 11:29:40 +0000
415+++ src/provisioningserver/tests/test_maas_import_pxe_files.py 2012-11-15 12:09:22 +0000
416@@ -161,9 +161,6 @@
417 # Suppress running of maas-import-ephemerals. It gets too
418 # intimate with the system to test here.
419 'IMPORT_EPHEMERALS': '0',
420- # Suppress running of maas-import-squashfs. It gets too
421- # intimate with the system to test here.
422- 'IMPORT_SQUASHFS': '0',
423 }
424 env.update(self.config_fixture.environ)
425 if arch is not None:

Subscribers

People subscribed via source and target branches

to status/vote changes: