[service] do not bluntly override these things if they exist stable
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Wed, 21 Apr 2010 14:08:18 +0200
branchstable
changeset 5365 ca838c79af97
parent 5362 e185d708a36f
child 5366 5f116a4d8a54
[service] do not bluntly override these things if they exist
etwist/service.py
--- a/etwist/service.py	Tue Apr 20 18:32:42 2010 +0200
+++ b/etwist/service.py	Wed Apr 21 14:08:18 2010 +0200
@@ -14,8 +14,10 @@
 logger = getLogger('cubicweb.twisted')
 logger.handlers = [handlers.NTEventLogHandler('cubicweb')]
 
-os.environ['CW_INSTANCES_DIR'] = r'C:\etc\cubicweb.d'
-os.environ['USERNAME'] = 'cubicweb'
+if not os.environ.get('CW_INSTANCES_DIR'):
+    os.environ['CW_INSTANCES_DIR'] = r'C:\etc\cubicweb.d'
+if not os.environ.get('USERNAME'):
+    os.environ['USERNAME'] = 'cubicweb'
 
 class CWService(object, win32serviceutil.ServiceFramework):
     _svc_name_ = None