Skip to content

Commit

Permalink
Merge pull request #76 from salsadigitalauorg/feature/action-base-rai…
Browse files Browse the repository at this point in the history
…se-error-when-no-creds

feat: raise error when no api credentials in LagoonActionBase
  • Loading branch information
yusufhm authored Feb 27, 2024
2 parents ec14ddc + fb6bad9 commit 4629d4b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/plugins/action/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
class LagoonActionBase(ActionBase):

def createClient(self, task_vars):
if not task_vars.get('lagoon_api_endpoint'):
raise AnsibleError("lagoon_api_endpoint is required")
if not task_vars.get('lagoon_api_token'):
raise AnsibleError("lagoon_api_token is required")
self.client = GqlClient(
self._templar.template(task_vars.get('lagoon_api_endpoint')).strip(),
self._templar.template(task_vars.get('lagoon_api_token')).strip(),
Expand Down

0 comments on commit 4629d4b

Please sign in to comment.