improved CLI
diff --git a/emuvim/dcemulator/net.py b/emuvim/dcemulator/net.py
index 1762e0b..83ac619 100644
--- a/emuvim/dcemulator/net.py
+++ b/emuvim/dcemulator/net.py
@@ -114,6 +114,15 @@
def getNextIp(self):
return self.mnet.getNextIp()
+ def getAllContainers(self):
+ """
+ Returns a list with all containers within all data centers.
+ """
+ all_containers = []
+ for dc in self.dcs.itervalues():
+ all_containers += dc.listCompute()
+ return all_containers
+
def start(self):
# start
for dc in self.dcs.itervalues():
diff --git a/emuvim/dcemulator/node.py b/emuvim/dcemulator/node.py
index 0d96033..de64d69 100644
--- a/emuvim/dcemulator/node.py
+++ b/emuvim/dcemulator/node.py
@@ -100,7 +100,7 @@
"""
assert name is not None
# no duplications
- if name in self.containers:
+ if name in [c.name for c in self.net.getAllContainers()]:
raise Exception("Container with name %s already exists." % name)
# set default parameter
if image is None: