diff mbox

[Branch,~linaro-validation/lava-server/trunk] Rev 234: Make production the default environment mode for lava-server

Message ID 20110905145514.31406.36489.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Zygmunt Krynicki Sept. 5, 2011, 2:55 p.m. UTC
------------------------------------------------------------
revno: 234
committer: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
branch nick: trunk
timestamp: Mon 2011-09-05 16:53:14 +0200
message:
  Make production the default environment mode for lava-server
modified:
  lava_server/manage.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/manage.py'
--- lava_server/manage.py	2011-09-05 12:51:34 +0000
+++ lava_server/manage.py	2011-09-05 14:53:14 +0000
@@ -64,11 +64,16 @@ 
 
     @classmethod
     def register_arguments(cls, parser):
-        parser.add_argument("-p", "--production",
+        group = parser.add_argument_group("Server configuration")
+        group.add_argument("-d", "--development",
+                            action="store_false",
+                            dest="production",
+                            help="Use development settings")
+        group.add_argument("-p", "--production",
                             action="store_true",
-                            default=False,
-                            help="Use production settings")
-        parser.add_argument("-i", "--instance",
+                            default=True,
+                            help="Use production settings (default)")
+        group.add_argument("-i", "--instance",
                             action="store",
                             default=None,
                             help="Use the specified instance (works only with --production)")
@@ -76,9 +81,10 @@ 
                             help="Invoke this Django management command")
 
     def invoke(self):
-        settings_module = "lava_server.settings.development"
         if self.args.production:
             settings_module = "lava_server.settings.debian"
+        else:
+            settings_module = "lava_server.settings.development"
         if self.args.instance:
             if not os.path.isdir(self.args.instance):
                 self.parser.error("Specified instance does not exsit")