IEEE.org     |     IEEE Xplore Digital Library     |     IEEE Standards     |     IEEE Spectrum     |     More Sites

Commit 05244048 authored by Mairi Dulaney's avatar Mairi Dulaney
Browse files

python lint aws_secrets

parent 94e5dad4
......@@ -73,13 +73,17 @@ def run_module():
result["secret_id"] = module.params["secret_id"]
try:
returned_secret = subprocess.run(
["aws", "secretsmanager", "get-secret-value", "--secret-id", module.params["secret_id"]],
[
"aws",
"secretsmanager",
"get-secret-value",
"--secret-id",
module.params["secret_id"],
],
capture_output=True,
).stdout.decode("utf-8")
if returned_secret:
secret_string = json.loads(returned_secret)[
"SecretString"
]
secret_string = json.loads(returned_secret)["SecretString"]
result["secret"] = re.sub('^"', "", re.sub('"$', "", secret_string))
else:
result["secret"] = ""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment