Custom inventory script environment variable blacklist

This commit is contained in:
Matthew Jones 2014-11-06 11:17:22 -05:00
parent ae55f1c0d3
commit 27fd173e72
2 changed files with 3 additions and 1 deletions

View File

@ -1052,7 +1052,7 @@ class RunInventoryUpdate(BaseTask):
pass
elif inventory_update.source == 'custom':
for env_k in inventory_update.source_vars_dict:
if str(env_k) not in os.environ:
if str(env_k) not in os.environ and str(env_k) not in settings.INV_ENV_VARIABLE_BLACKLIST:
env[str(env_k)] = unicode(inventory_update.source_vars_dict[env_k])
return env

View File

@ -351,6 +351,8 @@ RAX_GROUP_FILTER = r'^(?!instance-.+).+$'
RAX_HOST_FILTER = r'^.+$'
RAX_EXCLUDE_EMPTY_GROUPS = True
INV_ENV_VARIABLE_BLACKLIST = ("HOME", "_")
# ----------------
# -- Amazon EC2 --
# ----------------