diff mbox

[Branch,~linaro-validation/lava-server/trunk] Rev 236: Fix make instance pathname flexible

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

Commit Message

Zygmunt Krynicki Sept. 7, 2011, 4:21 p.m. UTC
------------------------------------------------------------
revno: 236
committer: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
branch nick: trunk
timestamp: Wed 2011-09-07 18:19:46 +0200
message:
  Fix make instance pathname flexible
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 14:53:14 +0000
+++ lava_server/manage.py	2011-09-07 16:19:46 +0000
@@ -77,6 +77,10 @@ 
                             action="store",
                             default=None,
                             help="Use the specified instance (works only with --production)")
+        group.add_argument("-I", "--instance-template",
+                           action="store",
+                           default="/srv/lava/instances/{instance}/etc/lava-server/{{filename}}.conf",
+                           help="Template used for constructing instance pathname. The default value is: %(default)s")
         parser.add_argument("command", nargs="...",
                             help="Invoke this Django management command")
 
@@ -88,7 +92,8 @@ 
         if self.args.instance:
             if not os.path.isdir(self.args.instance):
                 self.parser.error("Specified instance does not exsit")
-            os.environ["DJANGO_DEBIAN_SETTINGS_TEMPLATE"] = self.args.instance + "/etc/{filename}.conf"
+            os.environ["DJANGO_DEBIAN_SETTINGS_TEMPLATE"] = (
+                self.args.instance_template.format(instance=self.args.instance))
         settings = __import__(settings_module, fromlist=[''])
         from django.core.management import execute_manager
         execute_manager(settings, ['lava-server'] + self.args.command)