diff --git a/ops/pebble.py b/ops/pebble.py index d4ec9208a..1fb029673 100644 --- a/ops/pebble.py +++ b/ops/pebble.py @@ -181,7 +181,7 @@ 'IdentityDict', { # NOTE: ensure are kept up to date in all locations - 'access': Literal['untrusted', 'metrics', 'read', 'admin'], + 'access': "IdentityAccess | Literal['untrusted', 'metrics', 'read', 'admin']", 'local': 'NotRequired[LocalIdentityDict]', 'basic': 'NotRequired[BasicIdentityDict]', }, diff --git a/test/test_pebble.py b/test/test_pebble.py index 2c7ad3f8b..a30301e20 100644 --- a/test/test_pebble.py +++ b/test/test_pebble.py @@ -4305,7 +4305,7 @@ def test_local_identity_from_dict(self): def test_local_identity_from_dict_with_access_enum(self): identity = pebble.Identity.from_dict({ - 'access': pebble.IdentityAccess.ADMIN, # type: ignore + 'access': pebble.IdentityAccess.ADMIN, 'local': {'user-id': 42}, }) assert identity == pebble.Identity( @@ -4330,7 +4330,7 @@ def test_basic_identity_from_dict(self): def test_basic_identity_from_dict_with_access_enum(self): identity = pebble.Identity.from_dict({ - 'access': pebble.IdentityAccess.METRICS, # type: ignore + 'access': pebble.IdentityAccess.METRICS, 'basic': {'password': 'hashed password'}, }) assert identity == pebble.Identity(