Skip to content

Commit

Permalink
clean up temp logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Nilsty committed Aug 7, 2024
1 parent 51363b2 commit 316fd75
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions TerraformLibrary/terraformlibrary.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,9 @@ def get_terraform_state(self, script_path: str):
"""
command = f"{self.exec} -chdir={script_path} show -json"
rc, output = self._run_command(command)
logger.info(f'{output}')
if rc > 0:
logger.info(f'{output}')
logger.error(f"error = {output}")
return output
else:
try:
output_json = json.loads(output)
return output_json
except:
logger.warn("output not in json format")
return output

0 comments on commit 316fd75

Please sign in to comment.