Add conditional check

This commit is contained in:
Luke Murphy 2020-04-11 01:46:42 +02:00
parent e5127602f0
commit bba4ec271d
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with 3 additions and 2 deletions

View File

@ -21,8 +21,9 @@ def run_command(command, cwd=None, output=False, extra_env=None):
env.update({"REMOTE_USER": username})
env.update({"ANSIBLE_USER": username})
for key, val in extra_env.items():
env.update({key: val})
if extra_env:
for key, val in extra_env.items():
env.update({key: val})
try:
if cwd: