diff options
author | Joffrey F <joffrey@docker.com> | 2015-06-30 02:50:34 +0200 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2015-06-30 02:50:34 +0200 |
commit | 537543305881a536dbbe5b29e7812b847c4e7b38 (patch) | |
tree | 8ad334cd71db279c8eecc326eb6630bc6128a8f5 | |
parent | 37fb96334290eae49e17411a6b3af3f4f0fac0c9 (diff) | |
download | docker-py-537543305881a536dbbe5b29e7812b847c4e7b38.tar.gz |
Fix small decorator issue
-rw-r--r-- | docker/utils/decorators.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/docker/utils/decorators.py b/docker/utils/decorators.py index 5da3df8..3c42fe4 100644 --- a/docker/utils/decorators.py +++ b/docker/utils/decorators.py @@ -11,11 +11,11 @@ def check_resource(f): resource_id = kwargs.pop('container') elif kwargs.get('image'): resource_id = kwargs.pop('image') + if isinstance(resource_id, dict): + resource_id = resource_id.get('Id') if not resource_id: raise errors.NullResource( 'image or container param is undefined' ) - if isinstance(resource_id, dict): - resource_id = resource_id.get('Id') return f(self, resource_id, *args, **kwargs) return wrapped |