[Erp5-report] r42235 kazuhiko - /erp5/trunk/utils/cloudooo/cloudooo/paster_application.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jan 11 20:00:12 CET 2011


Author: kazuhiko
Date: Tue Jan 11 20:00:12 2011
New Revision: 42235

URL: http://svn.erp5.org?rev=42235&view=rev
Log:
* environment variable keys are case sensitive.
* allow specifying an empty string for the environment variable value.
* if PATH is specified, it should have higher priority than the existing value (but merging with the existing value might be a bad idea and might be removed later).

Modified:
    erp5/trunk/utils/cloudooo/cloudooo/paster_application.py

Modified: erp5/trunk/utils/cloudooo/cloudooo/paster_application.py
URL: http://svn.erp5.org/erp5/trunk/utils/cloudooo/cloudooo/paster_application.py?rev=42235&r1=42234&r2=42235&view=diff
==============================================================================
--- erp5/trunk/utils/cloudooo/cloudooo/paster_application.py [utf8] (original)
+++ erp5/trunk/utils/cloudooo/cloudooo/paster_application.py [utf8] Tue Jan 11 20:00:12 2011
@@ -66,13 +66,14 @@ def application(global_config, **local_c
   prefix = 'env-'
   environment_dict = {}
   for parameter_name, value in local_config.iteritems():
-    if value and parameter_name[:len(prefix)] == prefix:
-      variable_name = parameter_name[len(prefix):].upper()
+    if parameter_name.startswith(prefix):
+      value = value or ''
+      variable_name = parameter_name[len(prefix):]
       if variable_name == 'PATH':
         # merge only for PATH
         current_value = os.environ.get(variable_name, '')
         if current_value:
-          value = current_value + ':' + value
+          value = '%s:%s' % (value, current_value)
       environment_dict[variable_name] = value
 
   gc.enable()



More information about the Erp5-report mailing list