Skip to content

Commit cb1a678

Browse files
committed
Fix dict lookup
Charmhub sometimes sends Revision (with an "R"), sometimes sends revision (with an "r") to keep things spicy
1 parent 8c2300b commit cb1a678

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

juju/application.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,8 +750,9 @@ async def refresh(
750750

751751
# no, if we already have it (and upstream doesn't have a newer res available)
752752
if res_name in existing_resources:
753-
available_rev = resource['revision']
754-
existing_rev = existing_resources[res_name].unknown_fields.get('revision', -1)
753+
available_rev = resource.get('Revision', resource.get('revision', -1))
754+
u_fields = existing_resources[res_name].unknown_fields
755+
existing_rev = u_fields.get('Revision', resource.get('revision', -1))
755756
if existing_rev >= available_rev:
756757
continue
757758

0 commit comments

Comments
 (0)