Add migration warning and option to migrate to labels.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
This commit is contained in:
parent
ed50a0a3a0
commit
62059d55e6
7 changed files with 148 additions and 29 deletions
|
|
@ -64,7 +64,11 @@ class Container(object):
|
|||
|
||||
@property
|
||||
def number(self):
|
||||
return int(self.labels.get(LABEL_CONTAINER_NUMBER) or 0)
|
||||
number = self.labels.get(LABEL_CONTAINER_NUMBER)
|
||||
if not number:
|
||||
raise ValueError("Container {0} does not have a {1} label".format(
|
||||
self.short_id, LABEL_CONTAINER_NUMBER))
|
||||
return int(number)
|
||||
|
||||
@property
|
||||
def ports(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue