Skip to content

Commit

Permalink
Juju passes the expiry in a field 'expiry', not 'expires'.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyandrewmeyer committed Aug 15, 2024
1 parent 449793f commit febe47e
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ops/model.py
Original file line number Diff line number Diff line change
@@ -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:
2 changes: 1 addition & 1 deletion test/test_model.py
Original file line number Diff line number Diff line change
@@ -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',
},

0 comments on commit febe47e

Please # to comment.