← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jtv/maas/mandatory-nodegroup-name into lp:maas

 

Jeroen T. Vermeulen has proposed merging lp:~jtv/maas/mandatory-nodegroup-name into lp:maas.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~jtv/maas/mandatory-nodegroup-name/+merge/114389

After discussion with Raphaël, we plan to add node groups to the API, as /nodegroups/<name>.  That's where a worker will post its DHCP lease updates.  But it does require the node group to have a name; it previously defaulted to the empty string.

No tests are affected; factory.make_node_group used to leave the name blank but it now generates a randomized (but recognizable) name for the node group.


Jeroen
-- 
https://code.launchpad.net/~jtv/maas/mandatory-nodegroup-name/+merge/114389
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jtv/maas/mandatory-nodegroup-name into lp:maas.
=== modified file 'src/maasserver/models/nodegroup.py'
--- src/maasserver/models/nodegroup.py	2012-07-10 11:46:58 +0000
+++ src/maasserver/models/nodegroup.py	2012-07-11 11:06:36 +0000
@@ -44,8 +44,9 @@
 
     objects = NodeGroupManager()
 
-    # Name for the node group's DNS zone.
-    name = CharField(max_length=80, unique=True, editable=True, default="")
+    # A node group's name is also used for the group's DNS zone.
+    name = CharField(
+        max_length=80, unique=True, editable=True, blank=False, null=False)
 
     api_token = ForeignKey(Token, null=False, editable=False, unique=True)
     api_key = CharField(