← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~rvb/maas/maas-bug-941751 into lp:maas

 

Raphaël Badin has proposed merging lp:~rvb/maas/maas-bug-941751 into lp:maas with lp:~rvb/maas/maas-bug-941751-api as a prerequisite.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~rvb/maas/maas-bug-941751/+merge/95946

Use the 'maas_name' config value.

Provide a reasonable default as seen with mrevell: "$(User_name)'s", this way the default displayed name will be "$(User_name)'s MaaS".
-- 
https://code.launchpad.net/~rvb/maas/maas-bug-941751/+merge/95946
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~rvb/maas/maas-bug-941751 into lp:maas.
=== modified file 'src/maasserver/context_processors.py'
--- src/maasserver/context_processors.py	2012-02-22 09:00:53 +0000
+++ src/maasserver/context_processors.py	2012-03-05 16:59:20 +0000
@@ -14,6 +14,7 @@
     ]
 
 from django.conf import settings
+from maasserver.models import Config
 
 
 def yui(context):
@@ -24,4 +25,8 @@
 
 
 def global_options(context):
-    return {'global_options': {'site_name': 'Temporary Cluster Name'}}
+    return {
+        'global_options': {
+            'site_name': Config.objects.get_config('maas_name'),
+        }
+    }

=== modified file 'src/maasserver/models.py'
--- src/maasserver/models.py	2012-03-05 16:15:26 +0000
+++ src/maasserver/models.py	2012-03-05 16:59:20 +0000
@@ -23,6 +23,7 @@
 
 import copy
 import datetime
+import getpass
 import os
 import re
 from socket import gethostname
@@ -723,7 +724,7 @@
     'update_from_choice': (
         [['archive.ubuntu.com', 'archive.ubuntu.com']]),
     # Network section configuration.
-    'maas_name': '',
+    'maas_name': "%s's" % getpass.getuser().capitalize(),
     'provide_dhcp': False,
     ## /settings
     # The host name or address where the nodes can access the metadata