mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Make sure nothing is named "compute server".
This commit is contained in:
1 parent
b4a2bc5b47
commit
a17fa821bd
14 files changed
+44
-44
No files matched your search
@@ -23,7 +23,7 @@ from ..notification_queue import NotificationQueue
|
||||
class NotificationManager:
|
||||
"""
|
||||
Manage the notification queue where the controller
|
||||
will connect to get notifications from compute servers
|
||||
will connect to get notifications from computes
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
|
||||
@@ -46,7 +46,7 @@ log = logging.getLogger(__name__)
|
||||
|
||||
class Controller:
|
||||
"""
|
||||
The controller is responsible to manage one or more compute servers.
|
||||
The controller is responsible to manage one or more computes.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
@@ -542,9 +542,9 @@ class Controller:
|
||||
|
||||
async def add_compute(self, compute_id=None, name=None, force=False, connect=True, **kwargs):
|
||||
"""
|
||||
Add a server to the dictionary of compute servers controlled by this controller
|
||||
Add a server to the dictionary of computes controlled by this controller
|
||||
|
||||
:param compute_id: Compute server identifier
|
||||
:param compute_id: Compute identifier
|
||||
:param name: Compute name
|
||||
:param force: True skip security check
|
||||
:param connect: True connect to the compute immediately
|
||||
@@ -604,7 +604,7 @@ class Controller:
|
||||
"""
|
||||
Delete a compute node. Project using this compute will be close
|
||||
|
||||
:param compute_id: Compute server identifier
|
||||
:param compute_id: Compute identifier
|
||||
"""
|
||||
|
||||
try:
|
||||
@@ -628,14 +628,14 @@ class Controller:
|
||||
@property
|
||||
def computes(self):
|
||||
"""
|
||||
:returns: The dictionary of compute server managed by this controller
|
||||
:returns: The dictionary of computes managed by this controller
|
||||
"""
|
||||
|
||||
return self._computes
|
||||
|
||||
def get_compute(self, compute_id):
|
||||
"""
|
||||
Returns a compute server or raise a 404 error.
|
||||
Returns a compute or raise a 404 error.
|
||||
"""
|
||||
|
||||
try:
|
||||
|
||||
@@ -410,9 +410,9 @@ class Compute:
|
||||
msg = "GNS3 version {} is not the same as the GNS3 VM version {}. Please upgrade the GNS3 VM.".format(__version__,
|
||||
response.json["version"])
|
||||
else:
|
||||
msg = "GNS3 controller version {} is not the same as compute server {} version {}".format(__version__,
|
||||
self._name,
|
||||
response.json["version"])
|
||||
msg = "GNS3 controller version {} is not the same as compute {} version {}".format(__version__,
|
||||
self._name,
|
||||
response.json["version"])
|
||||
if __version_info__[3] == 0:
|
||||
# Stable release
|
||||
log.error(msg)
|
||||
|
||||
@@ -95,7 +95,7 @@ async def export_project(project, temporary_dir, include_images=False, keep_comp
|
||||
try:
|
||||
data = await response.content.read(1024)
|
||||
except asyncio.TimeoutError:
|
||||
raise aiohttp.web.HTTPRequestTimeout(text="Timeout when downloading file '{}' from remote compute server {}:{}".format(compute_file["path"], compute.host, compute.port))
|
||||
raise aiohttp.web.HTTPRequestTimeout(text="Timeout when downloading file '{}' from remote compute {}:{}".format(compute_file["path"], compute.host, compute.port))
|
||||
if not data:
|
||||
break
|
||||
f.write(data)
|
||||
@@ -256,7 +256,7 @@ async def _export_remote_images(project, compute_id, image_type, image, project_
|
||||
Export specific image from remote compute.
|
||||
"""
|
||||
|
||||
log.info("Downloading image '{}' from compute server '{}'".format(image, compute_id))
|
||||
log.info("Downloading image '{}' from compute '{}'".format(image, compute_id))
|
||||
|
||||
try:
|
||||
compute = [compute for compute in project.computes if compute.id == compute_id][0]
|
||||
@@ -274,7 +274,7 @@ async def _export_remote_images(project, compute_id, image_type, image, project_
|
||||
try:
|
||||
data = await response.content.read(1024)
|
||||
except asyncio.TimeoutError:
|
||||
raise aiohttp.web.HTTPRequestTimeout(text="Timeout when downloading image '{}' from remote compute server {}:{}".format(image, compute.host, compute.port))
|
||||
raise aiohttp.web.HTTPRequestTimeout(text="Timeout when downloading image '{}' from remote compute {}:{}".format(image, compute.host, compute.port))
|
||||
if not data:
|
||||
break
|
||||
f.write(data)
|
||||
|
||||
@@ -41,7 +41,7 @@ class Node:
|
||||
def __init__(self, project, compute, name, node_id=None, node_type=None, appliance_id=None, **kwargs):
|
||||
"""
|
||||
:param project: Project of the node
|
||||
:param compute: Compute server where the server will run
|
||||
: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
|
||||
@@ -345,7 +345,7 @@ class Node:
|
||||
|
||||
async def create(self):
|
||||
"""
|
||||
Create the node on the compute server
|
||||
Create the node on the compute
|
||||
"""
|
||||
data = self._node_data()
|
||||
data["node_id"] = self._id
|
||||
@@ -372,7 +372,7 @@ class Node:
|
||||
|
||||
async def update(self, **kwargs):
|
||||
"""
|
||||
Update the node on the compute server
|
||||
Update the node on the compute
|
||||
|
||||
:param kwargs: Node properties
|
||||
"""
|
||||
|
||||
@@ -31,13 +31,13 @@ log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class ComputeHandler:
|
||||
"""API entry points for compute server management."""
|
||||
"""API entry points for compute management."""
|
||||
|
||||
@Route.post(
|
||||
r"/computes",
|
||||
description="Register a compute server",
|
||||
description="Register a compute",
|
||||
status_codes={
|
||||
201: "Compute server added"
|
||||
201: "Compute added"
|
||||
},
|
||||
input=COMPUTE_CREATE_SCHEMA,
|
||||
output=COMPUTE_OBJECT_SCHEMA)
|
||||
@@ -49,9 +49,9 @@ class ComputeHandler:
|
||||
|
||||
@Route.get(
|
||||
r"/computes",
|
||||
description="List of compute servers",
|
||||
description="List of computes",
|
||||
status_codes={
|
||||
200: "Compute servers list returned"
|
||||
200: "Computes list returned"
|
||||
})
|
||||
def list(request, response):
|
||||
|
||||
@@ -60,9 +60,9 @@ class ComputeHandler:
|
||||
|
||||
@Route.put(
|
||||
r"/computes/{compute_id}",
|
||||
description="Update a compute server",
|
||||
description="Update a compute",
|
||||
status_codes={
|
||||
200: "Compute server updated",
|
||||
200: "Compute updated",
|
||||
400: "Invalid request",
|
||||
404: "Instance doesn't exist"
|
||||
},
|
||||
@@ -175,9 +175,9 @@ class ComputeHandler:
|
||||
|
||||
@Route.get(
|
||||
r"/computes/{compute_id}",
|
||||
description="Get a compute server information",
|
||||
description="Get a compute information",
|
||||
status_codes={
|
||||
200: "Compute server information returned"
|
||||
200: "Compute information returned"
|
||||
},
|
||||
output=COMPUTE_OBJECT_SCHEMA)
|
||||
def get(request, response):
|
||||
|
||||
@@ -43,7 +43,7 @@ class IndexHandler:
|
||||
|
||||
@Route.get(
|
||||
r"/compute",
|
||||
description="Resources used by the GNS3 compute servers"
|
||||
description="Resources used by the GNS3 computes"
|
||||
)
|
||||
def compute(request, response):
|
||||
response.template("compute.html",
|
||||
|
||||
@@ -89,7 +89,7 @@ COMPUTE_OBJECT_SCHEMA = {
|
||||
"type": ["string", "null"]
|
||||
},
|
||||
"connected": {
|
||||
"description": "Whether the controller is connected to the compute server or not",
|
||||
"description": "Whether the controller is connected to the compute or not",
|
||||
"type": "boolean"
|
||||
},
|
||||
"cpu_usage_percent": {
|
||||
|
||||
Reference in new issue
Block a user