Skip to content

Commit

Permalink
Add parsing of eventual settings.provider_labels for AT provider
Browse files Browse the repository at this point in the history
  • Loading branch information
rplevka committed Apr 22, 2024
1 parent 99eada8 commit b605076
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions broker/providers/ansible_tower.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,10 @@ def execute(self, **kwargs): # noqa: PLR0912,PLR0915 - Possible TODO refactor
payload["labels"] = self._resolve_labels(labels, target)
# record labels also as extra vars - use key=value format
kwargs["provider_labels"] = kwargs.get("provider_labels", {})
# include eventual common labels, specified at each level of configuration
# typically imported from dynaconf env vars
kwargs["provider_labels"].update(settings.get("provider_labels", {}))
kwargs["provider_labels"].update(settings.ANSIBLETOWER.get("provider_labels", {}))
kwargs["provider_labels"].update(
{label[0]: "=".join(label[1:]) for label in labels.items()}
)
Expand Down

0 comments on commit b605076

Please sign in to comment.