Skip to content

Commit

Permalink
Change format of expiration date from military time to standard time
Browse files Browse the repository at this point in the history
  • Loading branch information
vthiebaut10 committed Dec 17, 2021
1 parent 01fdf2b commit b01b728
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ssh/azext_ssh/ssh_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,15 +314,18 @@ def _prepare_relay_info_file(relay_info, credentials_folder, vm_name, resource_g

# Print the expiration of the relay information
expiration = datetime.datetime.fromtimestamp(relay_info.expires_on)
expiration = expiration.strftime("%Y-%m-%d %I:%M:%S %p")
print(f"Generated file with Relay Information {relay_info_path} is valid until {expiration}.\n")

return relay_info_path, relay_info_filename


def _issue_config_cleanup_warning(delete_cert, delete_keys, is_arc, cert_file, relay_info_filename, relay_info_path):
if delete_cert:
expiration = get_certificate_start_and_end_times(cert_file)[1]
expiration = expiration.strftime("%Y-%m-%d %I:%M:%S %p")
print(f"Generated SSH certificate {cert_file} is valid until",
f"{get_certificate_start_and_end_times(cert_file)[1]}.\n")
f"{expiration}.\n")

if delete_keys or delete_cert or is_arc:
# Warn users to delete credentials once config file is no longer being used.
Expand Down

0 comments on commit b01b728

Please sign in to comment.