Skip to content

Commit 02c1e65

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 27092e4 commit 02c1e65

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
@@ -759,8 +759,9 @@ async def refresh(
759759

760760
# no, if we already have it (and upstream doesn't have a newer res available)
761761
if res_name in existing_resources:
762-
available_rev = resource['revision']
763-
existing_rev = existing_resources[res_name].unknown_fields.get('revision', -1)
762+
available_rev = resource.get('Revision', resource.get('revision', -1))
763+
u_fields = existing_resources[res_name].unknown_fields
764+
existing_rev = u_fields.get('Revision', resource.get('revision', -1))
764765
if existing_rev >= available_rev:
765766
continue
766767

0 commit comments

Comments
 (0)