Merge lp:~rvb/maas/netboot-allocated-fix-mig-10-1.2 into lp:maas/1.2

Proposed by Raphaël Badin
Status: Merged
Approved by: Raphaël Badin
Approved revision: no longer in the source branch.
Merged at revision: 1384
Proposed branch: lp:~rvb/maas/netboot-allocated-fix-mig-10-1.2
Merge into: lp:maas/1.2
Diff against target: 28 lines (+9/-1)
1 file modified
src/maasserver/migrations/0010_add_node_netboot.py (+9/-1)
To merge this branch: bzr merge lp:~rvb/maas/netboot-allocated-fix-mig-10-1.2
Reviewer Review Type Date Requested Status
Julian Edwards (community) Approve
Review via email: mp+186378@code.launchpad.net

Commit message

Backport revision 1624. Set netboot=False on the allocated nodes with netboot=True. in migration #10.

To post a comment you must log in.
Revision history for this message
Julian Edwards (julian-edwards) wrote :

Feel free to self-approve straight backports.

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

> Feel free to self-approve straight backports.

ditto

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/maasserver/migrations/0010_add_node_netboot.py'
--- src/maasserver/migrations/0010_add_node_netboot.py 2012-06-18 03:20:51 +0000
+++ src/maasserver/migrations/0010_add_node_netboot.py 2013-09-18 15:54:38 +0000
@@ -4,9 +4,12 @@
44
5# encoding: utf-85# encoding: utf-8
6import datetime6import datetime
7
8from django.db import models
9from maasserver.enum import NODE_STATUS
7from south.db import db10from south.db import db
8from south.v2 import SchemaMigration11from south.v2 import SchemaMigration
9from django.db import models12
1013
11class Migration(SchemaMigration):14class Migration(SchemaMigration):
1215
@@ -15,6 +18,11 @@
15 # Adding field 'Node.netboot'18 # Adding field 'Node.netboot'
16 db.add_column(u'maasserver_node', 'netboot', self.gf('django.db.models.fields.BooleanField')(default=True), keep_default=False)19 db.add_column(u'maasserver_node', 'netboot', self.gf('django.db.models.fields.BooleanField')(default=True), keep_default=False)
1720
21 # Find all the allocated nodes with netboot=True.
22 allocated_nodes = orm['maasserver.node'].objects.filter(
23 status=NODE_STATUS.ALLOCATED, netboot=True)
24 # Set netboot=False on these nodes.
25 allocated_nodes.update(netboot=False)
1826
19 def backwards(self, orm):27 def backwards(self, orm):
20 28

Subscribers

People subscribed via source and target branches

to status/vote changes: