Skip to content
This repository has been archived by the owner on Mar 13, 2022. It is now read-only.

Commit

Permalink
Merge pull request #171 from Ark-kun/patch-1
Browse files Browse the repository at this point in the history
Fixed Watch.unmarshal_event when data is not a JSON-serialized object
  • Loading branch information
k8s-ci-robot committed Feb 21, 2020
2 parents ff9a5f3 + f11587d commit 7e7976b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions watch/watch.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ def unmarshal_event(self, data, return_type):
js = json.loads(data)
except ValueError:
return data
if not (isinstance(js, dict) and 'object' in js):
return data
js['raw_object'] = js['object']
if return_type:
obj = SimpleNamespace(data=json.dumps(js['raw_object']))
Expand Down

0 comments on commit 7e7976b

Please sign in to comment.