[mirrorbrain-commits] [opensuse-svn] r6444 - trunk/tools/download-redirector-v2/mirrordoctor

From: Novell Forge SVN <noreply_at_novell.com>
Date: Thu, 12 Feb 2009 10:45:56 -0700 (MST)
Author: poeml
Date: 2009-02-12 10:45:51 -0700 (Thu, 12 Feb 2009)
New Revision: 6444

Modified:
   trunk/tools/download-redirector-v2/mirrordoctor/mirrordoctor.py
Log:
mb tool: allow to set the mirrorbrain instance via MB env var (command option overrides it)

Modified: trunk/tools/download-redirector-v2/mirrordoctor/mirrordoctor.py
===================================================================
--- trunk/tools/download-redirector-v2/mirrordoctor/mirrordoctor.py	2009-02-12 13:11:32 UTC (rev 6443)
+++ trunk/tools/download-redirector-v2/mirrordoctor/mirrordoctor.py	2009-02-12 17:45:51 UTC (rev 6444)
_at_@ -66,14 +66,17 @@
         optparser.add_option('-b', '--brain-instance', 
                              help='the mirrorbrain instance to use. '
                                   'Corresponds to a section in '
-                                  '/etc/mirrorbrain.conf which is named the same.')
+                                  '/etc/mirrorbrain.conf which is named the same. '
+                                  'Can also specified via environment variable MB.')
         return optparser
 
 
     def postoptparse(self):
         """runs after parsing global options"""
 
-        import mb.conf
+        import os, mb.conf
+        if not self.options.brain_instance:
+            self.options.brain_instance = os.getenv('MB', default=None)
         self.config = mb.conf.Config(instance = self.options.brain_instance)
 
         # set up the database connection

_______________________________________________
Opensuse-svn mailing list
Opensuse-svn_at_forge.novell.com
http://forge.novell.com/mailman/listinfo/opensuse-svn


_______________________________________________
mirrorbrain-commits mailing list

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Thu Feb 12 2009 - 17:46:17 GMT

This archive was generated by hypermail 2.3.0 : Mon Feb 20 2012 - 23:47:04 GMT