Skip to content

Commit

Permalink
fix!: always return iso-8601 formatted date time (#453)
Browse files Browse the repository at this point in the history
##### SUMMARY

Fixes #91

Always return datetime as iso-8601 formatted strings.


##### ISSUE TYPE

- Bugfix Pull Request
  • Loading branch information
jooola committed Feb 5, 2024
1 parent d0c82ae commit 55d2616
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
breaking_changes:
- certificate_info - The `not_valid_before` and `not_valid_after` values are now returned as ISO-8601 formatted strings.
- certificate - The `not_valid_before` and `not_valid_after` values are now returned as ISO-8601 formatted strings.
- iso_info - The `deprecated` value is now returned as ISO-8601 formatted strings.
4 changes: 2 additions & 2 deletions plugins/modules/certificate.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ def _prepare_result(self):
"type": to_native(self.hcloud_certificate.type),
"fingerprint": to_native(self.hcloud_certificate.fingerprint),
"certificate": to_native(self.hcloud_certificate.certificate),
"not_valid_before": to_native(self.hcloud_certificate.not_valid_before),
"not_valid_after": to_native(self.hcloud_certificate.not_valid_after),
"not_valid_before": to_native(self.hcloud_certificate.not_valid_before.isoformat()),
"not_valid_after": to_native(self.hcloud_certificate.not_valid_after.isoformat()),
"domain_names": [to_native(domain) for domain in self.hcloud_certificate.domain_names],
"labels": self.hcloud_certificate.labels,
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/certificate_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ def _prepare_result(self):
"name": to_native(certificate.name),
"fingerprint": to_native(certificate.fingerprint),
"certificate": to_native(certificate.certificate),
"not_valid_before": to_native(certificate.not_valid_before),
"not_valid_after": to_native(certificate.not_valid_after),
"not_valid_before": to_native(certificate.not_valid_before.isoformat()),
"not_valid_after": to_native(certificate.not_valid_after.isoformat()),
"domain_names": [to_native(domain) for domain in certificate.domain_names],
"labels": certificate.labels,
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/iso_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def _prepare_result(self):
"type": iso_info.type,
"architecture": iso_info.architecture,
"deprecated": (
iso_info.deprecation.unavailable_after if iso_info.deprecation is not None else None
iso_info.deprecation.unavailable_after.isoformat() if iso_info.deprecation is not None else None
),
"deprecation": (
{
Expand Down

0 comments on commit 55d2616

Please sign in to comment.