fix
This commit is contained in:
parent
828eaf453a
commit
f75c502987
1 changed files with 3 additions and 3 deletions
|
@ -71,7 +71,7 @@ class LXC(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
logging.debug("")
|
logging.debug("")
|
||||||
|
|
||||||
def list(self, status=None):
|
def list_containers(self, status=None):
|
||||||
"""
|
"""
|
||||||
:return: ['container_first', 'container_second']
|
:return: ['container_first', 'container_second']
|
||||||
"""
|
"""
|
||||||
|
@ -89,7 +89,7 @@ class LXC(object):
|
||||||
"""
|
"""
|
||||||
checks if a given container is defined or not
|
checks if a given container is defined or not
|
||||||
"""
|
"""
|
||||||
if name in self.list():
|
if name in self.list_containers():
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ class LXC(object):
|
||||||
if not self.exists(name):
|
if not self.exists(name):
|
||||||
raise ContainerNotExists("The container (%s) does not exist!" % name)
|
raise ContainerNotExists("The container (%s) does not exist!" % name)
|
||||||
|
|
||||||
if name in self.list("running"):
|
if name in self.list_containers("running"):
|
||||||
raise ContainerAlreadyRunning('The container %s is already started!' % name)
|
raise ContainerAlreadyRunning('The container %s is already started!' % name)
|
||||||
|
|
||||||
cmd = ['lxc-start', '-n', name, '-d']
|
cmd = ['lxc-start', '-n', name, '-d']
|
||||||
|
|
Loading…
Add table
Reference in a new issue