integrated creation into the standard session.add_node call, currently requires an extra check due to the need for being able to specify an image
This commit is contained in:
parent
0e7464d419
commit
2397cd58ee
6 changed files with 49 additions and 34 deletions
|
@ -500,7 +500,10 @@ class Session(object):
|
|||
|
||||
# create node
|
||||
logging.info("creating node(%s) id(%s) name(%s) start(%s)", node_class.__name__, _id, name, start)
|
||||
node = self.create_node(cls=node_class, _id=_id, name=name, start=start)
|
||||
if _type == NodeTypes.DOCKER:
|
||||
node = self.create_node(cls=node_class, _id=_id, name=name, start=start, image=node_options.image)
|
||||
else:
|
||||
node = self.create_node(cls=node_class, _id=_id, name=name, start=start)
|
||||
|
||||
# set node attributes
|
||||
node.icon = node_options.icon
|
||||
|
@ -511,7 +514,7 @@ class Session(object):
|
|||
self.set_node_position(node, node_options)
|
||||
|
||||
# add services to default and physical nodes only
|
||||
if _type in [NodeTypes.DEFAULT, NodeTypes.PHYSICAL]:
|
||||
if _type in [NodeTypes.DEFAULT, NodeTypes.PHYSICAL, NodeTypes.DOCKER]:
|
||||
node.type = node_options.model
|
||||
logging.debug("set node type: %s", node.type)
|
||||
self.services.add_services(node, node.type, node_options.services)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue