Use "template" to name what we use to create new nodes.

This commit is contained in:
grossmj
2018-11-28 16:12:57 +07:00
parent 21c0a35f77
commit d7c2e16c21
262 changed files with 16588 additions and 16863 deletions

View File

@ -38,14 +38,14 @@ class Node:
"port_name_format", "first_port_name", "port_segment_size", "ports",
"category", "console_auto_start"]
def __init__(self, project, compute, name, node_id=None, node_type=None, appliance_id=None, **kwargs):
def __init__(self, project, compute, name, node_id=None, node_type=None, template_id=None, **kwargs):
"""
:param project: Project of the node
:param compute: Compute where the server will run
:param name: Node name
:param node_id: UUID of the node (integer)
:param node_type: Type of emulator
:param appliance_id: Appliance ID used to create this node
:param template_id: Template ID used to create this node
:param kwargs: Node properties
"""
@ -70,7 +70,7 @@ class Node:
self._command_line = None
self._node_directory = None
self._status = "stopped"
self._appliance_id = appliance_id
self._template_id = template_id
self._x = 0
self._y = 0
self._z = 1 # default z value is 1
@ -671,7 +671,7 @@ class Node:
"compute_id": str(self._compute.id),
"node_id": self._id,
"node_type": self._node_type,
"appliance_id": self._appliance_id,
"template_id": self._template_id,
"name": self._name,
"console": self._console,
"console_type": self._console_type,
@ -693,7 +693,7 @@ class Node:
"compute_id": str(self._compute.id),
"project_id": self._project.id,
"node_id": self._id,
"appliance_id": self._appliance_id,
"template_id": self._template_id,
"node_type": self._node_type,
"node_directory": self._node_directory,
"name": self._name,