Skip to content

Commit

Permalink
black code style check errors fixed. try2
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris Gorbuntsov committed Nov 28, 2024
1 parent 087b474 commit dc2d5a3
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions utils/client-cert.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,14 @@ def main(): # pylint:disable=too-many-locals
# create AWS session
session = get_session(profile)
if isinstance(session, dict):
print(
f'Error: Unable to open session using profile {profile_name}. {session["error"]}'
)
print(f'Error: Unable to open session using profile {profile_name}. {session["error"]}')
else:
print(f"AWS session opened using profile: {profile_name}")

# set variables
variables = parse_variables(client_template)
if "error" in variables:
print(
f'Error: Unable to read variables. Error reported is: {variables["error"]}'
)
print(f'Error: Unable to read variables. Error reported is: {variables["error"]}')
else:
print(f"Variables are obtained from file {client_template}")

Expand All @@ -109,9 +105,7 @@ def main(): # pylint:disable=too-many-locals
private_key = load_der_private_key(kms_response["PrivateKeyPlaintext"], None)

# create CSR
csr_info = create_csr_info(
common_name, country, locality, organization, organizational_unit, state
)
csr_info = create_csr_info(common_name, country, locality, organization, organizational_unit, state)
csr_pem = crypto_tls_cert_signing_request(private_key, csr_info)

# Construct JSON data to pass to Lambda function
Expand Down Expand Up @@ -167,9 +161,7 @@ def main(): # pylint:disable=too-many-locals
with open(output_path_cert_combined, "w", encoding="utf-8") as f:
f.write(key_data.decode("utf-8"))
f.write(cert_data.decode("utf-8"))
print(
f"Combined root and intermediate bundle written to {output_path_cert_combined}"
)
print(f"Combined root and intermediate bundle written to {output_path_cert_combined}")


if __name__ == "__main__":
Expand Down

0 comments on commit dc2d5a3

Please sign in to comment.