Merge lp:~blake-rouse/maas/fix-1508072-and-1508076 into lp:~maas-committers/maas/trunk

Proposed by Blake Rouse
Status: Merged
Approved by: Blake Rouse
Approved revision: no longer in the source branch.
Merged at revision: 4384
Proposed branch: lp:~blake-rouse/maas/fix-1508072-and-1508076
Merge into: lp:~maas-committers/maas/trunk
Diff against target: 48 lines (+17/-4)
3 files modified
src/maasserver/models/partition.py (+10/-3)
src/maasserver/models/tests/test_partition.py (+6/-0)
src/maasserver/websockets/handlers/subnet.py (+1/-1)
To merge this branch: bzr merge lp:~blake-rouse/maas/fix-1508072-and-1508076
Reviewer Review Type Date Requested Status
Andres Rodriguez (community) Approve
Review via email: mp+275050@code.launchpad.net

Commit message

Fix precache on subnet handler. Fix handling partition table being deleted before partitions.

To post a comment you must log in.
Revision history for this message
Andres Rodriguez (andreserl) wrote :

lgtm!

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :

The attempt to merge lp:~blake-rouse/maas/fix-1508072-and-1508076 into lp:maas failed. Below is the output from the failed tests.

Get:1 http://security.ubuntu.com trusty-security InRelease [64.4 kB]
Ign http://nova.clouds.archive.ubuntu.com trusty InRelease
Get:2 http://nova.clouds.archive.ubuntu.com trusty-updates InRelease [64.4 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty Release.gpg
Hit http://nova.clouds.archive.ubuntu.com trusty Release
Get:3 http://security.ubuntu.com trusty-security/main Sources [97.6 kB]
Get:4 http://nova.clouds.archive.ubuntu.com trusty-updates/main Sources [240 kB]
Get:5 http://security.ubuntu.com trusty-security/universe Sources [31.0 kB]
Get:6 http://security.ubuntu.com trusty-security/main amd64 Packages [355 kB]
Get:7 http://nova.clouds.archive.ubuntu.com trusty-updates/universe Sources [140 kB]
Get:8 http://security.ubuntu.com trusty-security/universe amd64 Packages [117 kB]
Get:9 http://nova.clouds.archive.ubuntu.com trusty-updates/main amd64 Packages [634 kB]
Get:10 http://security.ubuntu.com trusty-security/main Translation-en [193 kB]
Get:11 http://security.ubuntu.com trusty-security/universe Translation-en [68.3 kB]
Get:12 http://nova.clouds.archive.ubuntu.com trusty-updates/universe amd64 Packages [323 kB]
Get:13 http://nova.clouds.archive.ubuntu.com trusty-updates/main Translation-en [307 kB]
Get:14 http://nova.clouds.archive.ubuntu.com trusty-updates/universe Translation-en [170 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty/main Sources
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Sources
Hit http://nova.clouds.archive.ubuntu.com trusty/main amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty/universe amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en
Ign http://nova.clouds.archive.ubuntu.com trusty/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en_US
Fetched 2,805 kB in 4s (629 kB/s)

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

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

The attempt to merge lp:~blake-rouse/maas/fix-1508072-and-1508076 into lp:maas failed. Below is the output from the failed tests.

Hit http://security.ubuntu.com trusty-security InRelease
Ign http://nova.clouds.archive.ubuntu.com trusty InRelease
Hit http://nova.clouds.archive.ubuntu.com trusty-updates InRelease
Hit http://nova.clouds.archive.ubuntu.com trusty Release.gpg
Hit http://nova.clouds.archive.ubuntu.com trusty Release
Hit http://security.ubuntu.com trusty-security/main Sources
Hit http://security.ubuntu.com trusty-security/universe Sources
Hit http://security.ubuntu.com trusty-security/main amd64 Packages
Hit http://security.ubuntu.com trusty-security/universe amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/main Sources
Hit http://security.ubuntu.com trusty-security/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/universe Sources
Hit http://security.ubuntu.com trusty-security/universe Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/main amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/universe amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/universe Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty/main Sources
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Sources
Hit http://nova.clouds.archive.ubuntu.com trusty/main amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty/universe amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en
Ign http://nova.clouds.archive.ubuntu.com trusty/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en_US
Reading package lists...
sudo DEBIAN_FRONTEND=noninteractive apt-get -y \
     --no-install-recommends install apache2 authbind bind9 bind9utils build-essential bzr-builddeb chromium-browser chromium-chromedriver curl daemontools debhelper dh-apport dh-systemd distro-info dnsutils firefox freeipmi-tools git gjs ipython isc-dhcp-common libjs-angularjs libjs-jquery libjs-jquery-hotkeys libjs-yui3-full libjs-yui3-min libpq-dev make nodejs-legacy npm pep8 phantomjs postgresql pyflakes python-apt python-bson python-bzrlib python-convoy python-coverage python-crochet python-cssselect python-curtin python-dev python-distro-info python-django python-django-piston python-django-south python-djorm-ext-pgarray python-docutils python-extras python-fixtures python-flake8 python-formencode python-hivex python-httplib2 python-jinja2 python-jsonschema python-lxml python-mock python-netaddr python-netifaces python-nose python-oauth python-openssl python-paramiko python-pexpect python-pip python-pocket-lint python-psycopg2 python-pyinotify python-pyparsing python-seamicroclient python-simplejson python-simplestreams python-sphinx python-subunit python-tempita python-testresources python-testscenarios python-testtools python-twisted python-txtftp python-tz python-unittest2 python-virtualenv python-yaml python-zope.interface socat syslinux-common...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/maasserver/models/partition.py'
--- src/maasserver/models/partition.py 2015-10-15 19:36:22 +0000
+++ src/maasserver/models/partition.py 2015-10-20 15:04:48 +0000
@@ -300,7 +300,14 @@
300def delete_partition_table(sender, instance, **kwargs):300def delete_partition_table(sender, instance, **kwargs):
301 """Delete the partition table if this is the last partition on the301 """Delete the partition table if this is the last partition on the
302 partition table."""302 partition table."""
303 # Circular imports.
304 from maasserver.models.partitiontable import PartitionTable
303 if sender == Partition:305 if sender == Partition:
304 partition_table = instance.partition_table306 try:
305 if partition_table.partitions.count() == 0:307 partition_table = instance.partition_table
306 partition_table.delete()308 except PartitionTable.DoesNotExist:
309 # Partition table has already been removed nothing to do.
310 return
311 else:
312 if partition_table.partitions.count() == 0:
313 partition_table.delete()
307314
=== modified file 'src/maasserver/models/tests/test_partition.py'
--- src/maasserver/models/tests/test_partition.py 2015-10-16 13:34:30 +0000
+++ src/maasserver/models/tests/test_partition.py 2015-10-20 15:04:48 +0000
@@ -356,3 +356,9 @@
356 self.assertIsNotNone(reload_object(partition1))356 self.assertIsNotNone(reload_object(partition1))
357 self.assertIsNotNone(reload_object(partition_table))357 self.assertIsNotNone(reload_object(partition_table))
358 self.assertIsNone(reload_object(partition2))358 self.assertIsNone(reload_object(partition2))
359
360 def test_delete_partitiontable_before_partition_doesnt_raise_error(self):
361 partition_table = factory.make_PartitionTable()
362 factory.make_Partition(partition_table=partition_table)
363 # Test is that no error is raised.
364 partition_table.delete()
359365
=== modified file 'src/maasserver/websockets/handlers/subnet.py'
--- src/maasserver/websockets/handlers/subnet.py 2015-10-02 19:19:15 +0000
+++ src/maasserver/websockets/handlers/subnet.py 2015-10-20 15:04:48 +0000
@@ -34,7 +34,7 @@
34 .prefetch_related('nodegroupinterface_set__nodegroup')34 .prefetch_related('nodegroupinterface_set__nodegroup')
35 .prefetch_related('staticipaddress_set__user')35 .prefetch_related('staticipaddress_set__user')
36 .prefetch_related(36 .prefetch_related(
37 'staticipaddress_set__user__interface_set__node'))37 'staticipaddress_set__interface_set__node'))
38 pk = 'id'38 pk = 'id'
39 allowed_methods = ['list', 'get', 'set_active']39 allowed_methods = ['list', 'get', 'set_active']
40 listen_channels = [40 listen_channels = [