diff mbox

[Branch,~linaro-validation/lava-server/trunk] Rev 189: Merge a bunch of late fixes for issues discovered when actually trying to deploy everything

Message ID 20110705104539.30905.99429.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

Zygmunt Krynicki July 5, 2011, 10:45 a.m. UTC
Merge authors:
  Zygmunt Krynicki (zkrynicki)
Related merge proposals:
  https://code.launchpad.net/~zkrynicki/lava-server/fix-production-settings/+merge/66582
  proposed by: Zygmunt Krynicki (zkrynicki)
  review: Approve - Paul Larson (pwlars)
  https://code.launchpad.net/~zkrynicki/lava-server/contribute-to-settings-ex/+merge/66575
  proposed by: Zygmunt Krynicki (zkrynicki)
  review: Approve - Paul Larson (pwlars)
------------------------------------------------------------
revno: 189 [merge]
committer: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
branch nick: trunk
timestamp: Tue 2011-07-05 12:43:10 +0200
message:
  Merge a bunch of late fixes for issues discovered when actually trying to deploy everything
modified:
  lava_server/__init__.py
  lava_server/extension.py
  lava_server/htdocs/css/default.css
  lava_server/settings/common.py
  lava_server/settings/debian.py
  lava_server/settings/development.py
  lava_server/settings/production.py
  setup.py


--
lp:lava-server
https://code.launchpad.net/~linaro-validation/lava-server/trunk

You are subscribed to branch lp:lava-server.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-server/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_server/__init__.py'
--- lava_server/__init__.py	2011-06-23 18:50:08 +0000
+++ lava_server/__init__.py	2011-07-01 11:10:24 +0000
@@ -17,4 +17,4 @@ 
 # along with LAVA Server.  If not, see <http://www.gnu.org/licenses/>.
 
 
-__version__ = (0, 2, 0, "final", 0)
+__version__ = (0, 2, 1, "final", 0)

=== modified file 'lava_server/extension.py'
--- lava_server/extension.py	2011-06-08 03:47:04 +0000
+++ lava_server/extension.py	2011-07-01 10:11:07 +0000
@@ -31,13 +31,22 @@ 
     __metaclass__ = ABCMeta
 
     @abstractmethod
-    def contribute_to_settings(self, settings):
+    def contribute_to_settings(self, settings_module):
         """
         Add elements required to initialize this extension into the project
         settings module.
         """
 
     @abstractmethod
+    def contribute_to_settings_ex(self, settings_module, settings_object):
+        """
+        This method is similar to contribute_to_settings() but allows
+        implementation to access a settings object from django-debian. This
+        allows extensions to read settings provided by local system
+        administrator.
+        """
+
+    @abstractmethod
     def contribute_to_urlpatterns(self, urlpatterns):
         """
         Add application specific URLs to root URL patterns of lava-server
@@ -103,9 +112,12 @@ 
         """
         return None
 
-    def contribute_to_settings(self, settings):
-        settings['INSTALLED_APPS'].append(self.app_name)
-        settings['PREPEND_LABEL_APPS'].append(self.app_name)
+    def contribute_to_settings(self, settings_module):
+        settings_module['INSTALLED_APPS'].append(self.app_name)
+        settings_module['PREPEND_LABEL_APPS'].append(self.app_name)
+
+    def contribute_to_settings_ex(self, settings_module, settings_object):
+        pass
 
     def contribute_to_urlpatterns(self, urlpatterns):
         from django.conf.urls.defaults import url, include 
@@ -171,14 +183,18 @@ 
                     self._extensions.append(extension)
         return self._extensions
 
-    def contribute_to_settings(self, settings):
+    def contribute_to_settings(self, settings_module, settings_object=None):
         """
         Contribute to lava-server settings module.
 
-        The settings argument is a magic dictionary returned by locals()
+        The settings_object is optional (it may be None) and allows extensions
+        to look at the django-debian settings object. The settings_module
+        argument is a magic dictionary returned by locals()
         """
         for extension in self.extensions:
-            extension.contribute_to_settings(settings)
+            extension.contribute_to_settings(settings_module)
+            if settings_object is not None:
+                extension.contribute_to_settings_ex(settings_module, settings_object)
 
     def contribute_to_urlpatterns(self, urlpatterns):
         """

=== modified file 'lava_server/htdocs/css/default.css'
--- lava_server/htdocs/css/default.css	2011-06-29 14:02:57 +0000
+++ lava_server/htdocs/css/default.css	2011-07-01 11:09:44 +0000
@@ -221,7 +221,7 @@ 
 
 #content {
   color: #202020;
-  padding: 0 1px 0 0;
+  padding: 5pt;
   width: 78%;
 
   background-color: #F5F4E1;

=== modified file 'lava_server/settings/common.py'
--- lava_server/settings/common.py	2011-06-02 05:02:02 +0000
+++ lava_server/settings/common.py	2011-07-01 10:50:43 +0000
@@ -17,9 +17,6 @@ 
 # along with LAVA Server.  If not, see <http://www.gnu.org/licenses/>.
 
 
-from lava_server.extension import loader
-
-
 # Administrator contact, used for sending
 # emergency email when something breaks
 ADMINS = (
@@ -94,6 +91,7 @@ 
     # 'django.contrib.admindocs',
     # Admin docs disabled due to: https://code.djangoproject.com/ticket/6681
     'linaro_django_xmlrpc',
+    'south',
 ]
 
 TEMPLATE_CONTEXT_PROCESSORS = [
@@ -128,6 +126,3 @@ 
 # This is fixed in south 0.7.1, if we upgrade past that it's safe to
 # remove this line.
 SKIP_SOUTH_TESTS = True
-
-# Load extensions
-loader.contribute_to_settings(locals())

=== modified file 'lava_server/settings/debian.py'
--- lava_server/settings/debian.py	2011-05-24 13:28:57 +0000
+++ lava_server/settings/debian.py	2011-07-01 11:09:58 +0000
@@ -1,10 +1,12 @@ 
 # Django settings for django_hello project used on Debian systems.
 
 from django_debian.settings import Settings
+
+from lava_server.extension import loader
 from lava_server.settings.production import *
 
 # Load application settings from django-debian integration package
-debian_settings = Settings("lava")
+debian_settings = Settings("lava-server")
 
 # Load default database from Debian integration
 DATABASES = {
@@ -49,7 +51,7 @@ 
 
 # TODO: Debianize this
 STATICFILES_DIRS = [
-    ('', "/usr/share/lava/htdocs"),
+    ('lava', "/usr/share/lava-server/htdocs"),
 ]
 
 # A tuple that lists people who get code error notifications. When DEBUG=False
@@ -68,3 +70,6 @@ 
 # See also IGNORABLE_404_STARTS, IGNORABLE_404_ENDS and Error reporting via
 # e-mail.
 SEND_BROKEN_LINK_EMAILS=debian_settings.SEND_BROKEN_LINK_EMAILS
+
+# Load extensions
+loader.contribute_to_settings(locals(), debian_settings)

=== modified file 'lava_server/settings/development.py'
--- lava_server/settings/development.py	2011-06-29 14:10:50 +0000
+++ lava_server/settings/development.py	2011-07-05 10:43:10 +0000
@@ -18,6 +18,7 @@ 
 
 import os
 
+from lava_server.extension import loader
 from lava_server.settings.common import *
 
 
@@ -127,3 +128,6 @@ 
 # Any emails that would normally be sent are redirected to stdout. 
 # This setting is only used for django 1.2 and newer.
 EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
+
+# Load extensions
+loader.contribute_to_settings(locals())

=== modified file 'lava_server/settings/production.py'
--- lava_server/settings/production.py	2011-05-24 00:24:53 +0000
+++ lava_server/settings/production.py	2011-07-01 11:09:58 +0000
@@ -39,7 +39,7 @@ 
 # this is done externally to django URL resolver.
 APP_URL_PREFIX = r""
 # Data is served by external web server in "django-hello/"
-DATA_URL_PREFIX = r"lava/"
+DATA_URL_PREFIX = r""
 
 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
 # trailing slash if there is a path component (optional in other cases).

=== modified file 'setup.py'
--- setup.py	2011-07-05 10:18:29 +0000
+++ setup.py	2011-07-05 10:43:10 +0000
@@ -54,9 +54,10 @@ 
         "django-staticfiles == 0.3.4",
         'django < 1.3',
         'django-openid-auth >= 0.2',
+        'linaro-django-xmlrpc >= 0.3.2',
         'python-openid >= 2.2.4',  # this should be a part of django-openid-auth deps
+        'south >= 0.7.3',
         'versiontools >= 1.3.1',
-        'linaro-django-xmlrpc >= 0.3.2',
     ],
     setup_requires=[
         'versiontools >= 1.3.1',