Skip to content

Commit 5375433

Browse files
committed
Fix small decorator issue
1 parent 37fb963 commit 5375433

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docker/utils/decorators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ def wrapped(self, resource_id=None, *args, **kwargs):
1111
resource_id = kwargs.pop('container')
1212
elif kwargs.get('image'):
1313
resource_id = kwargs.pop('image')
14+
if isinstance(resource_id, dict):
15+
resource_id = resource_id.get('Id')
1416
if not resource_id:
1517
raise errors.NullResource(
1618
'image or container param is undefined'
1719
)
18-
if isinstance(resource_id, dict):
19-
resource_id = resource_id.get('Id')
2020
return f(self, resource_id, *args, **kwargs)
2121
return wrapped

0 commit comments

Comments
 (0)