diff options
author | Joffrey F <joffrey@docker.com> | 2015-06-30 01:49:20 +0200 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2015-06-30 01:49:20 +0200 |
commit | c2d98c204bdb3ddc4380e16e503b71788eb74b85 (patch) | |
tree | ace5d47bce5994dea0ffcf662f3a9175ebed6ad6 | |
parent | 237ce200138d6ca37280055142727abd663448bc (diff) | |
download | docker-py-c2d98c204bdb3ddc4380e16e503b71788eb74b85.tar.gz |
Cleanup
-rw-r--r-- | docker/utils/decorators.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/docker/utils/decorators.py b/docker/utils/decorators.py index d3869e8..5da3df8 100644 --- a/docker/utils/decorators.py +++ b/docker/utils/decorators.py @@ -4,7 +4,6 @@ from .. import errors def check_resource(f): - @functools.wraps(f) def wrapped(self, resource_id=None, *args, **kwargs): if resource_id is None: @@ -12,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 |