Skip to content

Commit c2d98c2

Browse files
committed
Cleanup
1 parent 237ce20 commit c2d98c2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

docker/utils/decorators.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@
44

55

66
def check_resource(f):
7-
87
@functools.wraps(f)
98
def wrapped(self, resource_id=None, *args, **kwargs):
109
if resource_id is None:
1110
if kwargs.get('container'):
1211
resource_id = kwargs.pop('container')
1312
elif kwargs.get('image'):
1413
resource_id = kwargs.pop('image')
15-
if isinstance(resource_id, dict):
16-
resource_id = resource_id.get('Id')
1714
if not resource_id:
1815
raise errors.NullResource(
1916
'image or container param is undefined'
2017
)
18+
if isinstance(resource_id, dict):
19+
resource_id = resource_id.get('Id')
2120
return f(self, resource_id, *args, **kwargs)
2221
return wrapped

0 commit comments

Comments
 (0)