Merge lp:~jtv/maas-test/no-import-ephemerals into lp:maas-test

Proposed by Jeroen T. Vermeulen
Status: Merged
Approved by: Jeroen T. Vermeulen
Approved revision: 142
Merged at revision: 142
Proposed branch: lp:~jtv/maas-test/no-import-ephemerals
Merge into: lp:maas-test
Diff against target: 84 lines (+5/-41)
2 files modified
maastest/maasfixture.py (+5/-27)
maastest/tests/test_maasfixture.py (+0/-14)
To merge this branch: bzr merge lp:~jtv/maas-test/no-import-ephemerals
Reviewer Review Type Date Requested Status
Julian Edwards (community) Approve
Review via email: mp+213958@code.launchpad.net

Commit message

Don't run the old maas-import-ephemerals script; it no longer exists.

Description of the change

This should fix current breakage, where the attempt to run the ephemerals import script fails. But an important part is still missing, for which I'd like to file a separate bug: now, it will download the default images (precise/trusty i386/amd64) instead of the specified architecture and series. We still need to write a bootresources.yaml.

It would be possible to leave the old environment variables in, to get at least a semblance of the old architecture/release selections when running against a pre-Trusty version of MAAS. But if we go that way now, we risk losing sight of which variable matters when, and ending up with an unmaintainable hairball of code. Trusty is the new LTS, and I would prefer to say: if you want to run maas-test against pre-Trusty versions of MAAS, use a pre-Trusty version of maas-test.

Jeroen

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

> if you want to run maas-test against pre-Trusty versions of MAAS, use a pre-Trusty version of maas-test.

I'm not sure we want to impose that on a user. How about checking for the presence of /etc/maas/bootresources.yaml and do the import the old way if it's not there still?

Revision history for this message
Gavin Panella (allenap) wrote :

> > if you want to run maas-test against pre-Trusty versions of MAAS, use a pre-
> Trusty version of maas-test.
>
> I'm not sure we want to impose that on a user. How about checking for the
> presence of /etc/maas/bootresources.yaml and do the import the old way if it's
> not there still?

maas-test is meant for Trusty though. I'm not sure we should even suggest running it on anything before Trusty.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

On Thursday 03 Apr 2014 16:10:28 you wrote:
> > > if you want to run maas-test against pre-Trusty versions of MAAS, use a
> > > pre->
> > Trusty version of maas-test.
> >
> > I'm not sure we want to impose that on a user. How about checking for the
> > presence of /etc/maas/bootresources.yaml and do the import the old way if
> > it's not there still?
>
> maas-test is meant for Trusty though. I'm not sure we should even suggest
> running it on anything before Trusty.

Agreed 100%. Please ignore anything other than trusty as released.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

Yep please do that extra bug. Thankfully it should be very easy to write the bootresources.yaml!

review: Approve
Revision history for this message
Raphaël Badin (rvb) wrote :

> Agreed 100%. Please ignore anything other than trusty as released.

All right. Then you should get rid of the param --simplestreams-filter because this branch effectively removes its effect.

Revision history for this message
Raphaël Badin (rvb) wrote :

> Agreed 100%. Please ignore anything other than trusty as released.

Also: bug 1302617.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'maastest/maasfixture.py'
2--- maastest/maasfixture.py 2014-03-03 05:34:25 +0000
3+++ maastest/maasfixture.py 2014-04-03 02:17:21 +0000
4@@ -1,4 +1,4 @@
5-# Copyright 2013 Canonical Ltd. This software is licensed under the
6+# Copyright 2013-2014 Canonical Ltd. This software is licensed under the
7 # GNU Affero General Public License version 3 (see the file LICENSE).
8
9 """Manage a MAAS installation."""
10@@ -226,42 +226,20 @@
11 arch_list = utils.mipf_arch_list(architecture)
12 arch_string = ' '.join(arch_list)
13 logging.info(
14- "Importing MAAS PXE files series=%s, architectures=%s..." % (
15+ "Importing boot images series=%s, architectures=%s..." % (
16 series, arch_string))
17 # Import boot images.
18+ # XXX jtv 2014-04-03: Configure /etc/maas/bootresources.yaml to import
19+ # just the right series & architecture.
20 self.kvm_fixture.run_command(
21 [
22 'sudo',
23- 'RELEASES=%s' % series,
24- 'ARCHES=%s' % arch_string,
25 'http_proxy=%s' % self.proxy_url,
26 'https_proxy=%s' % self.proxy_url,
27- 'IMPORT_EPHEMERALS=0',
28 'maas-import-pxe-files',
29 ],
30 check_call=True)
31- # Import ephemerals. We do this as a second step and not as part of
32- # the 'maas-import-pxe-files' run in case a custom simplestreams
33- # filter is given.
34- # Remove the 'subarch' part from the architecture list because
35- # simplestreams doesn't currently support subarch.
36- arches = [arch.split("/")[0] for arch in arch_list]
37- filters = [
38- utils.compose_filter('arch', arches),
39- 'release=%s' % series,
40- ]
41- if simplestreams_filter is not None:
42- filters.append(simplestreams_filter)
43- logging.info("Importing MAAS ephemerals %s..." % ' '.join(filters))
44- self.kvm_fixture.run_command(
45- [
46- 'sudo',
47- 'http_proxy=%s' % self.proxy_url,
48- 'https_proxy=%s' % self.proxy_url,
49- 'maas-import-ephemerals',
50- ] + filters,
51- check_call=True)
52- logging.info("Done importing MAAS PXE files and ephemerals.")
53+ logging.info("Done importing boot images.")
54
55 def configure(self, name, value):
56 """Set a config value in MAAS."""
57
58=== modified file 'maastest/tests/test_maasfixture.py'
59--- maastest/tests/test_maasfixture.py 2014-03-03 10:09:51 +0000
60+++ maastest/tests/test_maasfixture.py 2014-04-03 02:17:21 +0000
61@@ -756,24 +756,10 @@
62 self.assertEqual(
63 mock.call([
64 'sudo',
65- 'RELEASES=%s' % series,
66- 'ARCHES=%s' % ' '.join(returned_arches),
67 'http_proxy=%s' % proxy_url,
68 'https_proxy=%s' % proxy_url,
69- 'IMPORT_EPHEMERALS=0',
70 'maas-import-pxe-files',
71 ], check_call=True),
72- kvm_fixture.run_command.mock_calls[-2])
73- self.assertEqual(
74- mock.call([
75- 'sudo',
76- 'http_proxy=%s' % proxy_url,
77- 'https_proxy=%s' % proxy_url,
78- 'maas-import-ephemerals',
79- 'arch~(' + '|'.join(returned_arches) + ')',
80- 'release=%s' % series,
81- filter,
82- ], check_call=True),
83 kvm_fixture.run_command.mock_calls[-1])
84 self.assertEqual([mock.call(arch)], mock_mipf_arch_list.mock_calls)
85

Subscribers

People subscribed via source and target branches