Skip to content

Commit 5302e6a

Browse files
author
seba gomez
committed
The environment variable to replace the config entries was not honoring the documentation
If you want to override the setting TMPMEDIA_DIR under the [Client] section you'll have to add an environment variable called GX_TMPMEDIA_DIR If you want to override the setting JDBC_DRIVER under the [com.testjava|DEFAULT] section, you'll have to add a variable called GX_COM_TESTJAVA_DEFAULT_JDBC_DRIVER Always start with 'GX_', always in upper case, and always replace any special char ('.', '|') with an underscore ('_')
1 parent debd136 commit 5302e6a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

common/src/main/java/com/genexus/util/IniFile.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,14 +311,13 @@ private String getPropertyImpl(String section, String key) {
311311
private final String ENVVAR_PREFIX = "GX_";
312312

313313
private String getEnvironmentValue(String section, String key){
314-
315314
if (section != null && !section.isEmpty() && section != "Client"){
316315
for(int i = 0; i < m_invalidChars.length; i++)
317316
section = section.replace(m_invalidChars[i], "_");
318-
key = section + "_" + ENVVAR_PREFIX + key;
317+
key = String.format("%s%s_%s", ENVVAR_PREFIX, section.toUpperCase(), key.toUpperCase());
319318
}
320319
else
321-
key = ENVVAR_PREFIX + key;
320+
key = String.format("%s%s", ENVVAR_PREFIX, key.toUpperCase());
322321

323322
return System.getenv(key);
324323
}

0 commit comments

Comments
 (0)