diff --git a/ops/model.py b/ops/model.py index 3a9a1cfe3..f801a5b5d 100644 --- a/ops/model.py +++ b/ops/model.py @@ -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: diff --git a/test/test_model.py b/test/test_model.py index 0100570cb..e41ff0375 100644 --- a/test/test_model.py +++ b/test/test_model.py @@ -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', },