diff options
author | Aanand Prasad <aanand.prasad@gmail.com> | 2015-05-12 11:11:36 +0100 |
---|---|---|
committer | Aanand Prasad <aanand.prasad@gmail.com> | 2015-05-18 18:39:18 +0100 |
commit | ef4eb66723318af8aa189ce93fdd525a1f1d427d (patch) | |
tree | 52c8c84edb9c6209bf2279702ed214f4b3f4cda0 /compose/container.py | |
parent | 82bc7cd5ba84bcb6cc14ba9f8c8775dbfb8fa474 (diff) |
Implement smart recreate behind an experimental CLI flag
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
Diffstat (limited to 'compose/container.py')
-rw-r--r-- | compose/container.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compose/container.py b/compose/container.py index 3e462088..71951497 100644 --- a/compose/container.py +++ b/compose/container.py @@ -179,13 +179,16 @@ class Container(object): return self.client.attach_socket(self.id, **kwargs) def __repr__(self): - return '<Container: %s>' % self.name + return '<Container: %s (%s)>' % (self.name, self.id[:6]) def __eq__(self, other): if type(self) != type(other): return False return self.id == other.id + def __hash__(self): + return self.id.__hash__() + def get_container_name(container): if not container.get('Name') and not container.get('Names'): |