mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 11:18:11 +00:00
parent
cb70cfecd7
commit
a496aaab9e
@ -105,9 +105,7 @@ class BaseNode:
|
||||
def status(self, status):
|
||||
|
||||
self._node_status = status
|
||||
if status in ("started", "stopped", "suspended"):
|
||||
self.project.emit("node.{status}".format(status=status), {"node_id": self.id})
|
||||
self.project.emit("node.updated", self) # FIXME: should we send this when we just start/stop/suspend a node?
|
||||
self.project.emit("node.updated", self)
|
||||
|
||||
@property
|
||||
def command_line(self):
|
||||
|
@ -121,14 +121,14 @@ class Project:
|
||||
if compute not in self._project_created_on_compute:
|
||||
# For a local server we send the project path
|
||||
if compute.id == "local":
|
||||
yield from compute.post("/projects", {
|
||||
yield from compute.post("/projects", data={
|
||||
"name": self._name,
|
||||
"project_id": self._id,
|
||||
"temporary": self._temporary,
|
||||
"path": self._path
|
||||
})
|
||||
else:
|
||||
yield from compute.post("/projects", {
|
||||
yield from compute.post("/projects", data={
|
||||
"name": self._name,
|
||||
"project_id": self._id,
|
||||
"temporary": self._temporary
|
||||
|
@ -90,7 +90,7 @@ def test_add_node_local(async_run):
|
||||
|
||||
node = async_run(project.add_node(compute, None, name="test", node_type="vpcs", properties={"startup_config": "test.cfg"}))
|
||||
|
||||
compute.post.assert_any_call('/projects', {
|
||||
compute.post.assert_any_call('/projects', data={
|
||||
"name": project._name,
|
||||
"project_id": project._id,
|
||||
"temporary": project._temporary,
|
||||
@ -98,6 +98,7 @@ def test_add_node_local(async_run):
|
||||
})
|
||||
compute.post.assert_any_call('/projects/{}/vpcs/nodes'.format(project.id),
|
||||
data={'node_id': node.id,
|
||||
'console_type': 'telnet',
|
||||
'startup_config': 'test.cfg',
|
||||
'name': 'test'})
|
||||
assert compute in project._project_created_on_compute
|
||||
@ -117,13 +118,14 @@ def test_add_node_non_local(async_run):
|
||||
|
||||
node = async_run(project.add_node(compute, None, name="test", node_type="vpcs", properties={"startup_config": "test.cfg"}))
|
||||
|
||||
compute.post.assert_any_call('/projects', {
|
||||
compute.post.assert_any_call('/projects', data={
|
||||
"name": project._name,
|
||||
"project_id": project._id,
|
||||
"temporary": project._temporary
|
||||
})
|
||||
compute.post.assert_any_call('/projects/{}/vpcs/nodes'.format(project.id),
|
||||
data={'node_id': node.id,
|
||||
'console_type': 'telnet',
|
||||
'startup_config': 'test.cfg',
|
||||
'name': 'test'})
|
||||
assert compute in project._project_created_on_compute
|
||||
|
Loading…
Reference in New Issue
Block a user