Merge lp:~andreserl/maas/lp1573046 into lp:maas/1.9

Proposed by Andres Rodriguez
Status: Merged
Approved by: Andres Rodriguez
Approved revision: no longer in the source branch.
Merged at revision: 4561
Proposed branch: lp:~andreserl/maas/lp1573046
Merge into: lp:maas/1.9
Diff against target: 70 lines (+16/-5)
3 files modified
src/maasserver/api/tests/test_pxeconfig.py (+1/-1)
src/provisioningserver/drivers/osystem/tests/test_ubuntu.py (+9/-2)
src/provisioningserver/drivers/osystem/ubuntu.py (+6/-2)
To merge this branch: bzr merge lp:~andreserl/maas/lp1573046
Reviewer Review Type Date Requested Status
Andres Rodriguez (community) Approve
Blake Rouse (community) Approve
Review via email: mp+292528@code.launchpad.net

Commit message

DistroInfo has changed and shows Xenial as LTS. As such, MAAS 1.9 no longer shows available commissioning images for Trusty. This ensures that commissioning images available are only the supported ones.

To post a comment you must log in.
Revision history for this message
Blake Rouse (blake-rouse) wrote :

Code looks good, but no tests!

review: Needs Fixing
Revision history for this message
Blake Rouse (blake-rouse) wrote :

Looks good.

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :
Download full text (1.0 MiB)

The attempt to merge lp:~andreserl/maas/lp1573046 into lp:maas/1.9 failed. Below is the output from the failed tests.

Ign http://prodstack-zone-1.clouds.archive.ubuntu.com trusty InRelease
Get:1 http://security.ubuntu.com trusty-security InRelease [65.9 kB]
Get:2 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates InRelease [65.9 kB]
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports InRelease
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty Release.gpg
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty Release
Get:3 http://security.ubuntu.com trusty-security/main Sources [112 kB]
Get:4 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/main Sources [273 kB]
Get:5 http://security.ubuntu.com trusty-security/universe Sources [35.5 kB]
Get:6 http://security.ubuntu.com trusty-security/main amd64 Packages [457 kB]
Get:7 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/restricted Sources [5,352 B]
Get:8 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/universe Sources [154 kB]
Get:9 http://security.ubuntu.com trusty-security/universe amd64 Packages [126 kB]
Get:10 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/multiverse Sources [5,928 B]
Get:11 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/main amd64 Packages [755 kB]
Hit http://security.ubuntu.com trusty-security/main Translation-en
Hit http://security.ubuntu.com trusty-security/universe Translation-en
Get:12 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/restricted amd64 Packages [15.9 kB]
Get:13 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/universe amd64 Packages [358 kB]
Get:14 http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/multiverse amd64 Packages [13.2 kB]
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/main Translation-en
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/multiverse Translation-en
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/restricted Translation-en
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-updates/universe Translation-en
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/main Sources
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/restricted Sources
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/universe Sources
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/multiverse Sources
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/main amd64 Packages
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/restricted amd64 Packages
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/universe amd64 Packages
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/multiverse amd64 Packages
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/main Translation-en
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/multiverse Translation-en
Hit http://prodstack-zone-1.clouds.archive.ubuntu.com trusty-backports/restri...

Revision history for this message
Blake Rouse (blake-rouse) wrote :

======================================================================
FAIL: maasserver.api.tests.test_pxeconfig.TestPXEConfigAPI.test_pxeconfig_returns_commissioning_os_series_for_other_oses
----------------------------------------------------------------------
_StringException: Traceback (most recent call last):
  File "/tmp/tarmac/branch.9kmefJ/src/maastesting/runtest.py", line 68, in _run_user
    result = function(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 616, in _run_test_method
    return self._get_test_method()()
  File "/tmp/tarmac/branch.9kmefJ/src/maasserver/api/tests/test_pxeconfig.py", line 641, in test_pxeconfig_returns_commissioning_os_series_for_other_oses
    self.assertEqual(release, params_out["release"])
  File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 321, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 406, in assertThat
    raise mismatch_error
MismatchError: 'xenial' != u'trusty'

Revision history for this message
Andres Rodriguez (andreserl) wrote :

fixed test!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/maasserver/api/tests/test_pxeconfig.py'
--- src/maasserver/api/tests/test_pxeconfig.py 2015-10-23 17:53:22 +0000
+++ src/maasserver/api/tests/test_pxeconfig.py 2016-04-21 16:06:20 +0000
@@ -617,7 +617,7 @@
617617
618 def test_pxeconfig_returns_commissioning_os_series_for_other_oses(self):618 def test_pxeconfig_returns_commissioning_os_series_for_other_oses(self):
619 osystem = Config.objects.get_config('default_osystem')619 osystem = Config.objects.get_config('default_osystem')
620 release = Config.objects.get_config('default_distro_series')620 release = Config.objects.get_config('commissioning_distro_series')
621 nodegroup = factory.make_NodeGroup()621 nodegroup = factory.make_NodeGroup()
622 os_image = make_rpc_boot_image(purpose='xinstall')622 os_image = make_rpc_boot_image(purpose='xinstall')
623 architecture = '%s/%s' % (623 architecture = '%s/%s' % (
624624
=== modified file 'src/provisioningserver/drivers/osystem/tests/test_ubuntu.py'
--- src/provisioningserver/drivers/osystem/tests/test_ubuntu.py 2015-09-10 19:19:24 +0000
+++ src/provisioningserver/drivers/osystem/tests/test_ubuntu.py 2016-04-21 16:06:20 +0000
@@ -36,6 +36,13 @@
36 return info._format("fullname", row)36 return info._format("fullname", row)
37 return None37 return None
3838
39 def get_supported_lts_releases(self):
40 info = UbuntuDistroInfo()
41 unsupported_releases = ['precise', 'xenial']
42 return [name for name in info.supported()
43 if name not in unsupported_releases
44 if info.is_lts(name)]
45
39 def test_get_boot_image_purposes(self):46 def test_get_boot_image_purposes(self):
40 osystem = UbuntuOS()47 osystem = UbuntuOS()
41 archs = [factory.make_name('arch') for _ in range(2)]48 archs = [factory.make_name('arch') for _ in range(2)]
@@ -63,12 +70,12 @@
63 osystem = UbuntuOS()70 osystem = UbuntuOS()
64 expected = osystem.get_supported_commissioning_releases()71 expected = osystem.get_supported_commissioning_releases()
65 self.assertIsInstance(expected, list)72 self.assertIsInstance(expected, list)
66 self.assertEqual(expected, [self.get_lts_release()])73 self.assertEqual(expected, self.get_supported_lts_releases())
6774
68 def test_default_commissioning_release(self):75 def test_default_commissioning_release(self):
69 osystem = UbuntuOS()76 osystem = UbuntuOS()
70 expected = osystem.get_default_commissioning_release()77 expected = osystem.get_default_commissioning_release()
71 self.assertEqual(expected, self.get_lts_release())78 self.assertEqual(expected, 'trusty')
7279
73 def test_get_release_title(self):80 def test_get_release_title(self):
74 osystem = UbuntuOS()81 osystem = UbuntuOS()
7582
=== modified file 'src/provisioningserver/drivers/osystem/ubuntu.py'
--- src/provisioningserver/drivers/osystem/ubuntu.py 2015-09-24 16:22:12 +0000
+++ src/provisioningserver/drivers/osystem/ubuntu.py 2016-04-21 16:06:20 +0000
@@ -57,14 +57,18 @@
57 only exists on Ubuntu, because that is the only operating57 only exists on Ubuntu, because that is the only operating
58 system that supports commissioning.58 system that supports commissioning.
59 """59 """
60 return [self.get_lts_release()]60 info = UbuntuDistroInfo()
61 unsupported_releases = ['precise', 'xenial']
62 return [name for name in info.supported()
63 if name not in unsupported_releases
64 if info.is_lts(name)]
6165
62 def get_default_commissioning_release(self):66 def get_default_commissioning_release(self):
63 """Gets the default commissioning release for Ubuntu. This only exists67 """Gets the default commissioning release for Ubuntu. This only exists
64 on Ubuntu, because that is the only operating system that supports68 on Ubuntu, because that is the only operating system that supports
65 commissioning.69 commissioning.
66 """70 """
67 return self.get_lts_release()71 return 'trusty'
6872
69 def get_distro_series_info_row(self, release):73 def get_distro_series_info_row(self, release):
70 """Returns the distro series row information from python-distro-info.74 """Returns the distro series row information from python-distro-info.

Subscribers

People subscribed via source and target branches