Skip to content

Commit 8627287

Browse files
Handle strict mode with an empty entity
1 parent a627655 commit 8627287

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

juju/model.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,12 +917,15 @@ async def _all_watcher():
917917
pass # can't stop on a closed conn
918918
break
919919
for delta in results.deltas:
920+
entity = None
920921
try:
921922
entity = get_entity_delta(delta)
922923
except KeyError:
923924
if self.strict_mode:
924925
raise JujuError("unknown delta type '{}'".format(delta.entity))
925926

927+
if not self.strict_mode and entity is None:
928+
continue
926929
old_obj, new_obj = self.state.apply_delta(entity)
927930
await self._notify_observers(entity, old_obj, new_obj)
928931
# Post step ensure that we can handle any settings

0 commit comments

Comments
 (0)