Skip to content

Commit

Permalink
Apply AWX_TASK_ENV when performing credential plugin lookups
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanCoding committed Aug 2, 2023
1 parent 601b62d commit 79fb155
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions awx/main/models/credential/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from django.db import models
from django.utils.translation import gettext_lazy as _, gettext_noop
from django.core.exceptions import ValidationError
from django.conf import settings
from django.utils.encoding import force_str
from django.utils.functional import cached_property
from django.utils.timezone import now
Expand All @@ -30,7 +31,7 @@
CredentialTypeInjectorField,
DynamicCredentialInputField,
)
from awx.main.utils import decrypt_field, classproperty
from awx.main.utils import decrypt_field, classproperty, set_environ
from awx.main.utils.safe_yaml import safe_dump
from awx.main.utils.execution_environments import to_container_path
from awx.main.validators import validate_ssh_private_key
Expand Down Expand Up @@ -1252,7 +1253,9 @@ def get_input_value(self):
backend_kwargs[field_name] = value

backend_kwargs.update(self.metadata)
return backend(**backend_kwargs)

with set_environ(**settings.AWX_TASK_ENV):
return backend(**backend_kwargs)

def get_absolute_url(self, request=None):
view_name = 'api:credential_input_source_detail'
Expand Down

0 comments on commit 79fb155

Please sign in to comment.