fix!: always return iso-8601 formatted date time (#453)

##### SUMMARY

Fixes #91

Always return datetime as iso-8601 formatted strings.


##### ISSUE TYPE

- Bugfix Pull Request
This commit is contained in:
Jonas L 2024-02-05 12:18:53 +01:00 committed by GitHub
parent d0c82aec86
commit 55d26162b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 5 deletions

View file

@ -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.

View file

@ -165,8 +165,8 @@ class AnsibleHCloudCertificate(AnsibleHCloud):
"type": to_native(self.hcloud_certificate.type), "type": to_native(self.hcloud_certificate.type),
"fingerprint": to_native(self.hcloud_certificate.fingerprint), "fingerprint": to_native(self.hcloud_certificate.fingerprint),
"certificate": to_native(self.hcloud_certificate.certificate), "certificate": to_native(self.hcloud_certificate.certificate),
"not_valid_before": to_native(self.hcloud_certificate.not_valid_before), "not_valid_before": to_native(self.hcloud_certificate.not_valid_before.isoformat()),
"not_valid_after": to_native(self.hcloud_certificate.not_valid_after), "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], "domain_names": [to_native(domain) for domain in self.hcloud_certificate.domain_names],
"labels": self.hcloud_certificate.labels, "labels": self.hcloud_certificate.labels,
} }

View file

@ -110,8 +110,8 @@ class AnsibleHCloudCertificateInfo(AnsibleHCloud):
"name": to_native(certificate.name), "name": to_native(certificate.name),
"fingerprint": to_native(certificate.fingerprint), "fingerprint": to_native(certificate.fingerprint),
"certificate": to_native(certificate.certificate), "certificate": to_native(certificate.certificate),
"not_valid_before": to_native(certificate.not_valid_before), "not_valid_before": to_native(certificate.not_valid_before.isoformat()),
"not_valid_after": to_native(certificate.not_valid_after), "not_valid_after": to_native(certificate.not_valid_after.isoformat()),
"domain_names": [to_native(domain) for domain in certificate.domain_names], "domain_names": [to_native(domain) for domain in certificate.domain_names],
"labels": certificate.labels, "labels": certificate.labels,
} }

View file

@ -149,7 +149,7 @@ class AnsibleHCloudIsoInfo(AnsibleHCloud):
"type": iso_info.type, "type": iso_info.type,
"architecture": iso_info.architecture, "architecture": iso_info.architecture,
"deprecated": ( "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": ( "deprecation": (
{ {