Skip to content

Commit 3ecb63c

Browse files
authored
Remove default for WDT_MODEL_SECRETS_DIRS, skip check if not specified (#581)
* Remove default value for WDT_MODEL_SECRETS_DIRS, skip if not set
1 parent ce449b1 commit 3ecb63c

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

core/src/main/python/wlsdeploy/util/variables.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
_unresolved_token_pattern = re.compile("(@@(PROP|FILE|ENV|SECRET):)")
3535

3636
_secret_dirs_variable = "WDT_MODEL_SECRETS_DIRS"
37-
_secret_dirs_default = "/weblogic-operator/config-overrides-secrets"
3837
_secret_dir_pairs_variable="WDT_MODEL_SECRETS_NAME_DIR_PAIRS"
3938

4039
_secret_token_map = None
@@ -355,17 +354,19 @@ def _init_secret_token_map(model_context):
355354

356355
# add name/key pairs for files in sub-directories of directories in WDT_MODEL_SECRETS_DIRS.
357356

358-
locations = os.environ.get(_secret_dirs_variable, _secret_dirs_default)
359-
for dir in locations.split(","):
360-
if not os.path.isdir(dir):
361-
# log at WARN or INFO, but no exception is thrown
362-
log_method('WLSDPLY-01738', _secret_dirs_variable, dir, class_name=_class_name, method_name=method_name)
363-
continue
364-
365-
for subdir_name in os.listdir(dir):
366-
subdir_path = os.path.join(dir, subdir_name)
367-
if os.path.isdir(subdir_path):
368-
_add_file_secrets_to_map(subdir_path, subdir_name, model_context)
357+
locations = os.environ.get(_secret_dirs_variable, None)
358+
if locations is not None:
359+
for dir in locations.split(","):
360+
if not os.path.isdir(dir):
361+
# log at WARN or INFO, but no exception is thrown
362+
log_method('WLSDPLY-01738', _secret_dirs_variable, dir, class_name=_class_name,
363+
method_name=method_name)
364+
continue
365+
366+
for subdir_name in os.listdir(dir):
367+
subdir_path = os.path.join(dir, subdir_name)
368+
if os.path.isdir(subdir_path):
369+
_add_file_secrets_to_map(subdir_path, subdir_name, model_context)
369370

370371
# add name/key pairs for files in directories assigned in WDT_MODEL_SECRETS_NAME_DIR_PAIRS.
371372
# these pairs will override if they were previously added as sub-directory pairs.

0 commit comments

Comments
 (0)