Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: Juju passes the expiry in a field 'expiry', not 'expires' #1317

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ops/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ def __init__(
@classmethod
def from_dict(cls, id: str, d: Dict[str, Any]) -> 'SecretInfo':
"""Create new SecretInfo object from ID and dict parsed from JSON."""
expires = typing.cast(Optional[str], d.get('expires'))
expires = typing.cast(Optional[str], d.get('expiry'))
try:
rotation = SecretRotate(typing.cast(Optional[str], d.get('rotation')))
except ValueError:
Expand Down
2 changes: 1 addition & 1 deletion test/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3568,7 +3568,7 @@ def test_from_dict(self):
{
'label': 'fromdict',
'revision': 8,
'expires': '2022-12-09T14:10:00Z',
'expiry': '2022-12-09T14:10:00Z',
'rotation': 'yearly',
'rotates': '2023-01-09T14:10:00Z',
},
Expand Down
Loading