Skip to content

Commit

Permalink
formatted the conjur_variable.py script
Browse files Browse the repository at this point in the history
  • Loading branch information
ramavenkata-loya committed May 16, 2024
1 parent b646a67 commit 31ba2b6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugins/lookup/conjur_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,14 +319,15 @@ def _store_secret_in_file(value):

return [secrets_file.name]

class LookupModule(LookupBase):

class LookupModule(LookupBase):

def run(self, terms, variables=None, **kwargs):
if terms == []:
raise AnsibleError("Invalid secret path: no secret path provided.")
elif not terms[0] or terms[0].isspace():
raise AnsibleError("Invalid secret path: empty secret path not accepted.")

# We should register the variables as LookupModule options.
#
# Doing this has some nice advantages if we're considering supporting
Expand Down Expand Up @@ -384,7 +385,7 @@ def run(self, terms, variables=None, **kwargs):
"id": authn_login,
"api_key": authn_api_key
} if authn_login is not None
and authn_api_key is not None
and authn_api_key is not None
else {}
)

Expand Down Expand Up @@ -437,7 +438,7 @@ def run(self, terms, variables=None, **kwargs):
return _store_secret_in_file(conjur_variable)

return conjur_variable

def get_var_value(self, key):
try:
variable_value = self.get_option(key)
Expand Down

0 comments on commit 31ba2b6

Please sign in to comment.