mirror of
https://github.com/GNS3/gns3-server
synced 2025-05-09 18:38:53 +00:00
PEP 8 clean thanks to auto pep8
This commit is contained in:
parent
7f185663d1
commit
f5ed9fbcf1
@ -175,7 +175,6 @@ class BaseCloudCtrl(object):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error("list_instances returned an error: {}".format(e))
|
log.error("list_instances returned an error: {}".format(e))
|
||||||
|
|
||||||
|
|
||||||
def create_key_pair(self, name):
|
def create_key_pair(self, name):
|
||||||
""" Create and return a new Key Pair. """
|
""" Create and return a new Key Pair. """
|
||||||
|
|
||||||
|
@ -1,45 +1,67 @@
|
|||||||
""" Exception classes for CloudCtrl classes. """
|
""" Exception classes for CloudCtrl classes. """
|
||||||
|
|
||||||
|
|
||||||
class ApiError(Exception):
|
class ApiError(Exception):
|
||||||
|
|
||||||
""" Raised when the server returns 500 Compute Error. """
|
""" Raised when the server returns 500 Compute Error. """
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class BadRequest(Exception):
|
class BadRequest(Exception):
|
||||||
|
|
||||||
""" Raised when the server returns 400 Bad Request. """
|
""" Raised when the server returns 400 Bad Request. """
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class ComputeFault(Exception):
|
class ComputeFault(Exception):
|
||||||
|
|
||||||
""" Raised when the server returns 400|500 Compute Fault. """
|
""" Raised when the server returns 400|500 Compute Fault. """
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class Forbidden(Exception):
|
class Forbidden(Exception):
|
||||||
|
|
||||||
""" Raised when the server returns 403 Forbidden. """
|
""" Raised when the server returns 403 Forbidden. """
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class ItemNotFound(Exception):
|
class ItemNotFound(Exception):
|
||||||
|
|
||||||
""" Raised when the server returns 404 Not Found. """
|
""" Raised when the server returns 404 Not Found. """
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class KeyPairExists(Exception):
|
class KeyPairExists(Exception):
|
||||||
|
|
||||||
""" Raised when the server returns 409 Conflict Key pair exists. """
|
""" Raised when the server returns 409 Conflict Key pair exists. """
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class MethodNotAllowed(Exception):
|
class MethodNotAllowed(Exception):
|
||||||
|
|
||||||
""" Raised when the server returns 405 Method Not Allowed. """
|
""" Raised when the server returns 405 Method Not Allowed. """
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class OverLimit(Exception):
|
class OverLimit(Exception):
|
||||||
|
|
||||||
""" Raised when the server returns 413 Over Limit. """
|
""" Raised when the server returns 413 Over Limit. """
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class ServerCapacityUnavailable(Exception):
|
class ServerCapacityUnavailable(Exception):
|
||||||
|
|
||||||
""" Raised when the server returns 503 Server Capacity Uavailable. """
|
""" Raised when the server returns 503 Server Capacity Uavailable. """
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class ServiceUnavailable(Exception):
|
class ServiceUnavailable(Exception):
|
||||||
|
|
||||||
""" Raised when the server returns 503 Service Unavailable. """
|
""" Raised when the server returns 503 Service Unavailable. """
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class Unauthorized(Exception):
|
class Unauthorized(Exception):
|
||||||
|
|
||||||
""" Raised when the server returns 401 Unauthorized. """
|
""" Raised when the server returns 401 Unauthorized. """
|
||||||
pass
|
pass
|
||||||
|
@ -98,6 +98,8 @@ Options:
|
|||||||
""" % (SCRIPT_NAME)
|
""" % (SCRIPT_NAME)
|
||||||
|
|
||||||
# Parse cmd line options
|
# Parse cmd line options
|
||||||
|
|
||||||
|
|
||||||
def parse_cmd_line(argv):
|
def parse_cmd_line(argv):
|
||||||
"""
|
"""
|
||||||
Parse command line arguments
|
Parse command line arguments
|
||||||
@ -148,7 +150,6 @@ def parse_cmd_line(argv):
|
|||||||
else:
|
else:
|
||||||
cmd_line_option_list['syslog'] = ('localhost', 514)
|
cmd_line_option_list['syslog'] = ('localhost', 514)
|
||||||
|
|
||||||
|
|
||||||
get_gns3secrets(cmd_line_option_list)
|
get_gns3secrets(cmd_line_option_list)
|
||||||
cmd_line_option_list["dead_time"] = int(cmd_line_option_list["dead_time"])
|
cmd_line_option_list["dead_time"] = int(cmd_line_option_list["dead_time"])
|
||||||
|
|
||||||
@ -181,7 +182,7 @@ def parse_cmd_line(argv):
|
|||||||
elif (opt in ("--background")):
|
elif (opt in ("--background")):
|
||||||
cmd_line_option_list["daemon"] = True
|
cmd_line_option_list["daemon"] = True
|
||||||
|
|
||||||
if cmd_line_option_list["shutdown"] == False:
|
if cmd_line_option_list["shutdown"] is False:
|
||||||
|
|
||||||
if cmd_line_option_list["check-interval"] is None:
|
if cmd_line_option_list["check-interval"] is None:
|
||||||
cmd_line_option_list["check-interval"] = cmd_line_option_list["dead_time"] + 120
|
cmd_line_option_list["check-interval"] = cmd_line_option_list["dead_time"] + 120
|
||||||
@ -211,9 +212,9 @@ def parse_cmd_line(argv):
|
|||||||
print(usage)
|
print(usage)
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
|
||||||
|
|
||||||
return cmd_line_option_list
|
return cmd_line_option_list
|
||||||
|
|
||||||
|
|
||||||
def get_gns3secrets(cmd_line_option_list):
|
def get_gns3secrets(cmd_line_option_list):
|
||||||
"""
|
"""
|
||||||
Load cloud credentials from .gns3secrets
|
Load cloud credentials from .gns3secrets
|
||||||
@ -248,10 +249,10 @@ def set_logging(cmd_options):
|
|||||||
log_level = logging.INFO
|
log_level = logging.INFO
|
||||||
log_level_console = logging.WARNING
|
log_level_console = logging.WARNING
|
||||||
|
|
||||||
if cmd_options['verbose'] == True:
|
if cmd_options['verbose']:
|
||||||
log_level_console = logging.INFO
|
log_level_console = logging.INFO
|
||||||
|
|
||||||
if cmd_options['debug'] == True:
|
if cmd_options['debug']:
|
||||||
log_level_console = logging.DEBUG
|
log_level_console = logging.DEBUG
|
||||||
log_level = logging.DEBUG
|
log_level = logging.DEBUG
|
||||||
|
|
||||||
@ -275,6 +276,7 @@ def set_logging(cmd_options):
|
|||||||
|
|
||||||
return log
|
return log
|
||||||
|
|
||||||
|
|
||||||
def send_shutdown(pid_file):
|
def send_shutdown(pid_file):
|
||||||
"""
|
"""
|
||||||
Sends the daemon process a kill signal
|
Sends the daemon process a kill signal
|
||||||
@ -294,6 +296,7 @@ def _get_file_age(filename):
|
|||||||
os.path.getmtime(filename)
|
os.path.getmtime(filename)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def monitor_loop(options):
|
def monitor_loop(options):
|
||||||
"""
|
"""
|
||||||
Checks the options["file"] modification time against an interval. If the
|
Checks the options["file"] modification time against an interval. If the
|
||||||
@ -307,7 +310,7 @@ def monitor_loop(options):
|
|||||||
|
|
||||||
terminate_attempts = 0
|
terminate_attempts = 0
|
||||||
|
|
||||||
while options['shutdown'] == False:
|
while options['shutdown'] is False:
|
||||||
log.debug("In monitor_loop for : %s" % (
|
log.debug("In monitor_loop for : %s" % (
|
||||||
datetime.datetime.now() - options['starttime'])
|
datetime.datetime.now() - options['starttime'])
|
||||||
)
|
)
|
||||||
@ -372,14 +375,13 @@ def main():
|
|||||||
for key, value in iter(sorted(options.items())):
|
for key, value in iter(sorted(options.items())):
|
||||||
log.debug("%s : %s" % (key, value))
|
log.debug("%s : %s" % (key, value))
|
||||||
|
|
||||||
|
|
||||||
log.debug("Checking file ....")
|
log.debug("Checking file ....")
|
||||||
if os.path.isfile(options["file"]) == False:
|
if os.path.isfile(options["file"]) is False:
|
||||||
log.critical("File does not exist!!!")
|
log.critical("File does not exist!!!")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
test_acess = _get_file_age(options["file"])
|
test_acess = _get_file_age(options["file"])
|
||||||
if type(test_acess) is not datetime.datetime:
|
if not isinstance(test_acess, datetime.datetime):
|
||||||
log.critical("Can't get file modification time!!!")
|
log.critical("Can't get file modification time!!!")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
@ -390,13 +392,11 @@ def main():
|
|||||||
|
|
||||||
|
|
||||||
class MyDaemon(daemon.daemon):
|
class MyDaemon(daemon.daemon):
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
monitor_loop(self.options)
|
monitor_loop(self.options)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
result = main()
|
result = main()
|
||||||
sys.exit(result)
|
sys.exit(result)
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,8 +1,14 @@
|
|||||||
"""Generic linux daemon base class for python 3.x."""
|
"""Generic linux daemon base class for python 3.x."""
|
||||||
|
|
||||||
import sys, os, time, atexit, signal
|
import sys
|
||||||
|
import os
|
||||||
|
import time
|
||||||
|
import atexit
|
||||||
|
import signal
|
||||||
|
|
||||||
|
|
||||||
class daemon:
|
class daemon:
|
||||||
|
|
||||||
"""A generic daemon class.
|
"""A generic daemon class.
|
||||||
|
|
||||||
Usage: subclass the daemon class and override the run() method."""
|
Usage: subclass the daemon class and override the run() method."""
|
||||||
@ -114,7 +120,7 @@ class daemon:
|
|||||||
|
|
||||||
# Try killing the daemon process
|
# Try killing the daemon process
|
||||||
try:
|
try:
|
||||||
while 1:
|
while True:
|
||||||
os.kill(pid, signal.SIGTERM)
|
os.kill(pid, signal.SIGTERM)
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
except OSError as err:
|
except OSError as err:
|
||||||
|
@ -23,7 +23,8 @@
|
|||||||
# or negative for a release candidate or beta (after the base version
|
# or negative for a release candidate or beta (after the base version
|
||||||
# number has been incremented)
|
# number has been incremented)
|
||||||
|
|
||||||
import os, sys
|
import os
|
||||||
|
import sys
|
||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import socket
|
import socket
|
||||||
@ -34,7 +35,9 @@ from gns3dms.cloud.rackspace_ctrl import RackspaceCtrl
|
|||||||
LOG_NAME = "gns3dms.rksp"
|
LOG_NAME = "gns3dms.rksp"
|
||||||
log = logging.getLogger("%s" % (LOG_NAME))
|
log = logging.getLogger("%s" % (LOG_NAME))
|
||||||
|
|
||||||
|
|
||||||
class Rackspace(object):
|
class Rackspace(object):
|
||||||
|
|
||||||
def __init__(self, options):
|
def __init__(self, options):
|
||||||
self.username = options["cloud_user_name"]
|
self.username = options["cloud_user_name"]
|
||||||
self.apikey = options["cloud_api_key"]
|
self.apikey = options["cloud_api_key"]
|
||||||
|
@ -30,6 +30,7 @@ CLOUD_SERVER = 'CLOUD_SERVER'
|
|||||||
|
|
||||||
|
|
||||||
class Config(object):
|
class Config(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Configuration file management using configparser.
|
Configuration file management using configparser.
|
||||||
"""
|
"""
|
||||||
@ -117,7 +118,7 @@ class Config(object):
|
|||||||
:returns: configparser section
|
:returns: configparser section
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if not section in self._config:
|
if section is not in self._config:
|
||||||
return self._config["DEFAULT"]
|
return self._config["DEFAULT"]
|
||||||
return self._config[section]
|
return self._config[section]
|
||||||
|
|
||||||
|
@ -27,7 +27,9 @@ import tornado.websocket
|
|||||||
import logging
|
import logging
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class GNS3BaseHandler(tornado.web.RequestHandler):
|
class GNS3BaseHandler(tornado.web.RequestHandler):
|
||||||
|
|
||||||
def get_current_user(self):
|
def get_current_user(self):
|
||||||
if 'required_user' not in self.settings:
|
if 'required_user' not in self.settings:
|
||||||
return "FakeUser"
|
return "FakeUser"
|
||||||
@ -39,7 +41,9 @@ class GNS3BaseHandler(tornado.web.RequestHandler):
|
|||||||
if self.settings['required_user'] == user.decode("utf-8"):
|
if self.settings['required_user'] == user.decode("utf-8"):
|
||||||
return user
|
return user
|
||||||
|
|
||||||
|
|
||||||
class GNS3WebSocketBaseHandler(tornado.websocket.WebSocketHandler):
|
class GNS3WebSocketBaseHandler(tornado.websocket.WebSocketHandler):
|
||||||
|
|
||||||
def get_current_user(self):
|
def get_current_user(self):
|
||||||
if 'required_user' not in self.settings:
|
if 'required_user' not in self.settings:
|
||||||
return "FakeUser"
|
return "FakeUser"
|
||||||
@ -53,6 +57,7 @@ class GNS3WebSocketBaseHandler(tornado.websocket.WebSocketHandler):
|
|||||||
|
|
||||||
|
|
||||||
class LoginHandler(tornado.web.RequestHandler):
|
class LoginHandler(tornado.web.RequestHandler):
|
||||||
|
|
||||||
def get(self):
|
def get(self):
|
||||||
self.write('<html><body><form action="/login" method="post">'
|
self.write('<html><body><form action="/login" method="post">'
|
||||||
'Name: <input type="text" name="name">'
|
'Name: <input type="text" name="name">'
|
||||||
|
@ -34,6 +34,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class FileUploadHandler(GNS3BaseHandler):
|
class FileUploadHandler(GNS3BaseHandler):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
File upload handler.
|
File upload handler.
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ from aiohttp.web import HTTPConflict
|
|||||||
|
|
||||||
|
|
||||||
class ProjectHandler:
|
class ProjectHandler:
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@Route.post(
|
@Route.post(
|
||||||
r"/project",
|
r"/project",
|
||||||
|
@ -22,6 +22,7 @@ from ..modules.virtualbox import VirtualBox
|
|||||||
|
|
||||||
|
|
||||||
class VirtualBoxHandler:
|
class VirtualBoxHandler:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
API entry points for VirtualBox.
|
API entry points for VirtualBox.
|
||||||
"""
|
"""
|
||||||
|
@ -23,6 +23,7 @@ from ..modules.vpcs import VPCS
|
|||||||
|
|
||||||
|
|
||||||
class VPCSHandler:
|
class VPCSHandler:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
API entry points for VPCS.
|
API entry points for VPCS.
|
||||||
"""
|
"""
|
||||||
|
@ -27,6 +27,7 @@ from gns3server.version import __version__
|
|||||||
import logging
|
import logging
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def locale_check():
|
def locale_check():
|
||||||
"""
|
"""
|
||||||
Checks if this application runs with a correct locale (i.e. supports UTF-8 encoding) and attempt to fix
|
Checks if this application runs with a correct locale (i.e. supports UTF-8 encoding) and attempt to fix
|
||||||
@ -75,7 +76,6 @@ def main():
|
|||||||
|
|
||||||
current_year = datetime.date.today().year
|
current_year = datetime.date.today().year
|
||||||
|
|
||||||
|
|
||||||
# TODO: Renable the test when we will have command line
|
# TODO: Renable the test when we will have command line
|
||||||
# user_log = logging.getLogger('user_facing')
|
# user_log = logging.getLogger('user_facing')
|
||||||
# if not options.quiet:
|
# if not options.quiet:
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
class Adapter(object):
|
class Adapter(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Base class for adapters.
|
Base class for adapters.
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class EthernetAdapter(Adapter):
|
class EthernetAdapter(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
VPCS Ethernet adapter.
|
VPCS Ethernet adapter.
|
||||||
"""
|
"""
|
||||||
|
@ -24,6 +24,7 @@ from .project_manager import ProjectManager
|
|||||||
|
|
||||||
|
|
||||||
class BaseManager:
|
class BaseManager:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Base class for all Manager.
|
Base class for all Manager.
|
||||||
Responsible of management of a VM pool
|
Responsible of management of a VM pool
|
||||||
|
@ -95,6 +95,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class Dynamips(IModule):
|
class Dynamips(IModule):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips module.
|
Dynamips module.
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
class Adapter(object):
|
class Adapter(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Base class for adapters.
|
Base class for adapters.
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class C1700_MB_1FE(Adapter):
|
class C1700_MB_1FE(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Integrated 1 port FastEthernet adapter for c1700 platform.
|
Integrated 1 port FastEthernet adapter for c1700 platform.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class C1700_MB_WIC1(Adapter):
|
class C1700_MB_WIC1(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Fake module to provide a placeholder for slot 1 interfaces when WICs
|
Fake module to provide a placeholder for slot 1 interfaces when WICs
|
||||||
are inserted into WIC slot 1.
|
are inserted into WIC slot 1.
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class C2600_MB_1E(Adapter):
|
class C2600_MB_1E(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Integrated 1 port Ethernet adapter for the c2600 platform.
|
Integrated 1 port Ethernet adapter for the c2600 platform.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class C2600_MB_1FE(Adapter):
|
class C2600_MB_1FE(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Integrated 1 port FastEthernet adapter for the c2600 platform.
|
Integrated 1 port FastEthernet adapter for the c2600 platform.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class C2600_MB_2E(Adapter):
|
class C2600_MB_2E(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Integrated 2 port Ethernet adapter for the c2600 platform.
|
Integrated 2 port Ethernet adapter for the c2600 platform.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class C2600_MB_2FE(Adapter):
|
class C2600_MB_2FE(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Integrated 2 port FastEthernet adapter for the c2600 platform.
|
Integrated 2 port FastEthernet adapter for the c2600 platform.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class C7200_IO_2FE(Adapter):
|
class C7200_IO_2FE(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
C7200-IO-2FE FastEthernet Input/Ouput controller.
|
C7200-IO-2FE FastEthernet Input/Ouput controller.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class C7200_IO_FE(Adapter):
|
class C7200_IO_FE(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
C7200-IO-FE FastEthernet Input/Ouput controller.
|
C7200-IO-FE FastEthernet Input/Ouput controller.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class C7200_IO_GE_E(Adapter):
|
class C7200_IO_GE_E(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
C7200-IO-GE-E GigabitEthernet Input/Ouput controller.
|
C7200-IO-GE-E GigabitEthernet Input/Ouput controller.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class Leopard_2FE(Adapter):
|
class Leopard_2FE(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Integrated 2 port FastEthernet adapter for c3660 router.
|
Integrated 2 port FastEthernet adapter for c3660 router.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class NM_16ESW(Adapter):
|
class NM_16ESW(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
NM-16ESW FastEthernet network module.
|
NM-16ESW FastEthernet network module.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class NM_1E(Adapter):
|
class NM_1E(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
NM-1E Ethernet network module.
|
NM-1E Ethernet network module.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class NM_1FE_TX(Adapter):
|
class NM_1FE_TX(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
NM-1FE-TX FastEthernet network module.
|
NM-1FE-TX FastEthernet network module.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class NM_4E(Adapter):
|
class NM_4E(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
NM-4E Ethernet network module.
|
NM-4E Ethernet network module.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class NM_4T(Adapter):
|
class NM_4T(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
NM-4T Serial network module.
|
NM-4T Serial network module.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class PA_2FE_TX(Adapter):
|
class PA_2FE_TX(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
PA-2FE-TX FastEthernet port adapter.
|
PA-2FE-TX FastEthernet port adapter.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class PA_4E(Adapter):
|
class PA_4E(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
PA-4E Ethernet port adapter.
|
PA-4E Ethernet port adapter.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class PA_4T(Adapter):
|
class PA_4T(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
PA-4T+ Serial port adapter.
|
PA-4T+ Serial port adapter.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class PA_8E(Adapter):
|
class PA_8E(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
PA-8E Ethernet port adapter.
|
PA-8E Ethernet port adapter.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class PA_8T(Adapter):
|
class PA_8T(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
PA-8T Serial port adapter.
|
PA-8T Serial port adapter.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class PA_A1(Adapter):
|
class PA_A1(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
PA-A1 ATM port adapter.
|
PA-A1 ATM port adapter.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class PA_FE_TX(Adapter):
|
class PA_FE_TX(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
PA-FE-TX FastEthernet port adapter.
|
PA-FE-TX FastEthernet port adapter.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class PA_GE(Adapter):
|
class PA_GE(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
PA-GE GigabitEthernet port adapter.
|
PA-GE GigabitEthernet port adapter.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class PA_POS_OC3(Adapter):
|
class PA_POS_OC3(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
PA-POS-OC3 port adapter.
|
PA-POS-OC3 port adapter.
|
||||||
"""
|
"""
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
class WIC_1ENET(object):
|
class WIC_1ENET(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
WIC-1ENET Ethernet
|
WIC-1ENET Ethernet
|
||||||
"""
|
"""
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
class WIC_1T(object):
|
class WIC_1T(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
WIC-1T Serial
|
WIC-1T Serial
|
||||||
"""
|
"""
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
class WIC_2T(object):
|
class WIC_2T(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
WIC-2T Serial
|
WIC-2T Serial
|
||||||
"""
|
"""
|
||||||
|
@ -466,7 +466,7 @@ class VM(object):
|
|||||||
adapter_name = value
|
adapter_name = value
|
||||||
adapter = ADAPTER_MATRIX[adapter_name]()
|
adapter = ADAPTER_MATRIX[adapter_name]()
|
||||||
try:
|
try:
|
||||||
if router.slots[slot_id] and type(router.slots[slot_id]) != type(adapter):
|
if router.slots[slot_id] and not isinstance(router.slots[slot_id], type(adapter)):
|
||||||
router.slot_remove_binding(slot_id)
|
router.slot_remove_binding(slot_id)
|
||||||
router.slot_add_binding(slot_id, adapter)
|
router.slot_add_binding(slot_id, adapter)
|
||||||
response[name] = value
|
response[name] = value
|
||||||
@ -487,14 +487,14 @@ class VM(object):
|
|||||||
wic_name = value
|
wic_name = value
|
||||||
wic = WIC_MATRIX[wic_name]()
|
wic = WIC_MATRIX[wic_name]()
|
||||||
try:
|
try:
|
||||||
if router.slots[0].wics[wic_slot_id] and type(router.slots[0].wics[wic_slot_id]) != type(wic):
|
if router.slots[0].wics[wic_slot_id] and not isinstance(router.slots[0].wics[wic_slot_id], type(wic)):
|
||||||
router.uninstall_wic(wic_slot_id)
|
router.uninstall_wic(wic_slot_id)
|
||||||
router.install_wic(wic_slot_id, wic)
|
router.install_wic(wic_slot_id, wic)
|
||||||
response[name] = value
|
response[name] = value
|
||||||
except DynamipsError as e:
|
except DynamipsError as e:
|
||||||
self.send_custom_error(str(e))
|
self.send_custom_error(str(e))
|
||||||
return
|
return
|
||||||
elif name.startswith("wic") and value == None:
|
elif name.startswith("wic") and value is None:
|
||||||
wic_slot_id = int(name[-1])
|
wic_slot_id = int(name[-1])
|
||||||
if router.slots[0].wics and router.slots[0].wics[wic_slot_id]:
|
if router.slots[0].wics and router.slots[0].wics[wic_slot_id]:
|
||||||
try:
|
try:
|
||||||
|
@ -30,6 +30,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class DynamipsHypervisor(object):
|
class DynamipsHypervisor(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Creates a new connection to a Dynamips server (also called hypervisor)
|
Creates a new connection to a Dynamips server (also called hypervisor)
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class Hypervisor(DynamipsHypervisor):
|
class Hypervisor(DynamipsHypervisor):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Hypervisor.
|
Hypervisor.
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class HypervisorManager(object):
|
class HypervisorManager(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Manages Dynamips hypervisors.
|
Manages Dynamips hypervisors.
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class NIO(object):
|
class NIO(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Base NIO class
|
Base NIO class
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class NIO_FIFO(NIO):
|
class NIO_FIFO(NIO):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips FIFO NIO.
|
Dynamips FIFO NIO.
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class NIO_GenericEthernet(NIO):
|
class NIO_GenericEthernet(NIO):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips generic Ethernet NIO.
|
Dynamips generic Ethernet NIO.
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class NIO_LinuxEthernet(NIO):
|
class NIO_LinuxEthernet(NIO):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips Linux Ethernet NIO.
|
Dynamips Linux Ethernet NIO.
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class NIO_Mcast(NIO):
|
class NIO_Mcast(NIO):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips Linux Ethernet NIO.
|
Dynamips Linux Ethernet NIO.
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class NIO_Null(NIO):
|
class NIO_Null(NIO):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips NULL NIO.
|
Dynamips NULL NIO.
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class NIO_TAP(NIO):
|
class NIO_TAP(NIO):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips TAP NIO.
|
Dynamips TAP NIO.
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class NIO_UDP(NIO):
|
class NIO_UDP(NIO):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips UDP NIO.
|
Dynamips UDP NIO.
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class NIO_UDP_auto(NIO):
|
class NIO_UDP_auto(NIO):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips auto UDP NIO.
|
Dynamips auto UDP NIO.
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class NIO_UNIX(NIO):
|
class NIO_UNIX(NIO):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips UNIX NIO.
|
Dynamips UNIX NIO.
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class NIO_VDE(NIO):
|
class NIO_VDE(NIO):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips VDE NIO.
|
Dynamips VDE NIO.
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ from ..dynamips_error import DynamipsError
|
|||||||
|
|
||||||
|
|
||||||
class ATMBridge(object):
|
class ATMBridge(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips bridge switch.
|
Dynamips bridge switch.
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class ATMSwitch(object):
|
class ATMSwitch(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips ATM switch.
|
Dynamips ATM switch.
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ http://github.com/GNS3/dynamips/blob/master/README.hypervisor#L538
|
|||||||
|
|
||||||
|
|
||||||
class Bridge(object):
|
class Bridge(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips bridge.
|
Dynamips bridge.
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class C1700(Router):
|
class C1700(Router):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips c1700 router.
|
Dynamips c1700 router.
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class C2600(Router):
|
class C2600(Router):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips c2600 router.
|
Dynamips c2600 router.
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class C2691(Router):
|
class C2691(Router):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips c2691 router.
|
Dynamips c2691 router.
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class C3600(Router):
|
class C3600(Router):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips c3600 router.
|
Dynamips c3600 router.
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class C3725(Router):
|
class C3725(Router):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips c3725 router.
|
Dynamips c3725 router.
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class C3745(Router):
|
class C3745(Router):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips c3745 router.
|
Dynamips c3745 router.
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class C7200(Router):
|
class C7200(Router):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips c7200 router (model is 7206).
|
Dynamips c7200 router (model is 7206).
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class EthernetSwitch(object):
|
class EthernetSwitch(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips Ethernet switch.
|
Dynamips Ethernet switch.
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class FrameRelaySwitch(object):
|
class FrameRelaySwitch(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips Frame Relay switch.
|
Dynamips Frame Relay switch.
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class Hub(Bridge):
|
class Hub(Bridge):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips hub (based on Bridge)
|
Dynamips hub (based on Bridge)
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class Router(object):
|
class Router(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Dynamips router implementation.
|
Dynamips router implementation.
|
||||||
|
|
||||||
|
@ -56,6 +56,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class IOU(IModule):
|
class IOU(IModule):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
IOU module.
|
IOU module.
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
class Adapter(object):
|
class Adapter(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Base class for adapters.
|
Base class for adapters.
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class EthernetAdapter(Adapter):
|
class EthernetAdapter(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
IOU Ethernet adapter.
|
IOU Ethernet adapter.
|
||||||
"""
|
"""
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class SerialAdapter(Adapter):
|
class SerialAdapter(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
IOU Serial adapter.
|
IOU Serial adapter.
|
||||||
"""
|
"""
|
||||||
|
@ -43,6 +43,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class IOUDevice(object):
|
class IOUDevice(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
IOU device implementation.
|
IOU device implementation.
|
||||||
|
|
||||||
|
@ -154,6 +154,7 @@ class FileLock:
|
|||||||
|
|
||||||
|
|
||||||
class Console:
|
class Console:
|
||||||
|
|
||||||
def fileno(self):
|
def fileno(self):
|
||||||
raise NotImplementedError("Only routers have fileno()")
|
raise NotImplementedError("Only routers have fileno()")
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ Base interface for NIOs.
|
|||||||
|
|
||||||
|
|
||||||
class NIO(object):
|
class NIO(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Network Input/Output.
|
Network Input/Output.
|
||||||
"""
|
"""
|
||||||
|
@ -23,6 +23,7 @@ from .nio import NIO
|
|||||||
|
|
||||||
|
|
||||||
class NIO_GenericEthernet(NIO):
|
class NIO_GenericEthernet(NIO):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Generic Ethernet NIO.
|
Generic Ethernet NIO.
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ from .nio import NIO
|
|||||||
|
|
||||||
|
|
||||||
class NIO_TAP(NIO):
|
class NIO_TAP(NIO):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
TAP NIO.
|
TAP NIO.
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ from .nio import NIO
|
|||||||
|
|
||||||
|
|
||||||
class NIO_UDP(NIO):
|
class NIO_UDP(NIO):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
UDP NIO.
|
UDP NIO.
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ Interface for TAP NIOs (UNIX based OSes only).
|
|||||||
|
|
||||||
|
|
||||||
class NIO_TAP(object):
|
class NIO_TAP(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
TAP NIO.
|
TAP NIO.
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ Interface for UDP NIOs.
|
|||||||
|
|
||||||
|
|
||||||
class NIO_UDP(object):
|
class NIO_UDP(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
UDP NIO.
|
UDP NIO.
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ import asyncio
|
|||||||
|
|
||||||
|
|
||||||
class PortManager:
|
class PortManager:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
:param host: IP address to bind for console connections
|
:param host: IP address to bind for console connections
|
||||||
"""
|
"""
|
||||||
|
@ -21,6 +21,7 @@ from uuid import uuid4
|
|||||||
|
|
||||||
|
|
||||||
class Project:
|
class Project:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
A project contains a list of VM.
|
A project contains a list of VM.
|
||||||
In theory VM are isolated project/project.
|
In theory VM are isolated project/project.
|
||||||
|
@ -20,6 +20,7 @@ from .project import Project
|
|||||||
|
|
||||||
|
|
||||||
class ProjectManager:
|
class ProjectManager:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
This singleton keeps track of available projects.
|
This singleton keeps track of available projects.
|
||||||
"""
|
"""
|
||||||
|
@ -49,6 +49,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class Qemu(IModule):
|
class Qemu(IModule):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
QEMU module.
|
QEMU module.
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
class Adapter(object):
|
class Adapter(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Base class for adapters.
|
Base class for adapters.
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ from .adapter import Adapter
|
|||||||
|
|
||||||
|
|
||||||
class EthernetAdapter(Adapter):
|
class EthernetAdapter(Adapter):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
QEMU Ethernet adapter.
|
QEMU Ethernet adapter.
|
||||||
"""
|
"""
|
||||||
|
@ -21,6 +21,7 @@ Base interface for NIOs.
|
|||||||
|
|
||||||
|
|
||||||
class NIO(object):
|
class NIO(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Network Input/Output.
|
Network Input/Output.
|
||||||
"""
|
"""
|
||||||
|
@ -23,6 +23,7 @@ from .nio import NIO
|
|||||||
|
|
||||||
|
|
||||||
class NIO_UDP(NIO):
|
class NIO_UDP(NIO):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
UDP NIO.
|
UDP NIO.
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class QemuVM(object):
|
class QemuVM(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
QEMU VM implementation.
|
QEMU VM implementation.
|
||||||
|
|
||||||
@ -462,7 +463,6 @@ class QemuVM(object):
|
|||||||
disk_image=hdb_disk_image))
|
disk_image=hdb_disk_image))
|
||||||
self._hdb_disk_image = hdb_disk_image
|
self._hdb_disk_image = hdb_disk_image
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def adapters(self):
|
def adapters(self):
|
||||||
"""
|
"""
|
||||||
@ -586,7 +586,6 @@ class QemuVM(object):
|
|||||||
priority=process_priority))
|
priority=process_priority))
|
||||||
self._process_priority = process_priority
|
self._process_priority = process_priority
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def ram(self):
|
def ram(self):
|
||||||
"""
|
"""
|
||||||
|
@ -31,6 +31,7 @@ if sys.platform.startswith("win"):
|
|||||||
|
|
||||||
|
|
||||||
class TelnetServer(threading.Thread):
|
class TelnetServer(threading.Thread):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Mini Telnet Server.
|
Mini Telnet Server.
|
||||||
|
|
||||||
@ -257,6 +258,7 @@ LINEMO = 34 # Line Mode
|
|||||||
|
|
||||||
|
|
||||||
class TelnetClient(object):
|
class TelnetClient(object):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Represents a Telnet client connection.
|
Represents a Telnet client connection.
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class VirtualBoxVM(BaseVM):
|
class VirtualBoxVM(BaseVM):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
VirtualBox VM implementation.
|
VirtualBox VM implementation.
|
||||||
"""
|
"""
|
||||||
@ -367,7 +368,6 @@ class VirtualBoxVM(BaseVM):
|
|||||||
except OSError as e:
|
except OSError as e:
|
||||||
raise VirtualBoxError("Could not write HDD info file: {}".format(e))
|
raise VirtualBoxError("Could not write HDD info file: {}".format(e))
|
||||||
|
|
||||||
|
|
||||||
log.info("VirtualBox VM {name} [id={id}] has been deleted".format(name=self._name,
|
log.info("VirtualBox VM {name} [id={id}] has been deleted".format(name=self._name,
|
||||||
id=self._id))
|
id=self._id))
|
||||||
|
|
||||||
|
@ -43,6 +43,7 @@ log = logging.getLogger(__name__)
|
|||||||
|
|
||||||
|
|
||||||
class VPCSVM(BaseVM):
|
class VPCSVM(BaseVM):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
VPCS vm implementation.
|
VPCS vm implementation.
|
||||||
|
|
||||||
@ -53,6 +54,7 @@ class VPCSVM(BaseVM):
|
|||||||
:param working_dir: path to a working directory
|
:param working_dir: path to a working directory
|
||||||
:param console: TCP console port
|
:param console: TCP console port
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, name, uuid, project, manager, working_dir=None, console=None):
|
def __init__(self, name, uuid, project, manager, working_dir=None, console=None):
|
||||||
|
|
||||||
super().__init__(name, uuid, project, manager)
|
super().__init__(name, uuid, project, manager)
|
||||||
|
@ -25,4 +25,3 @@
|
|||||||
|
|
||||||
__version__ = "1.3.dev1"
|
__version__ = "1.3.dev1"
|
||||||
__version_info__ = (1, 3, 0, 0)
|
__version_info__ = (1, 3, 0, 0)
|
||||||
|
|
||||||
|
@ -22,7 +22,9 @@ from gns3server.web.route import Route
|
|||||||
|
|
||||||
|
|
||||||
class Documentation(object):
|
class Documentation(object):
|
||||||
|
|
||||||
"""Extract API documentation as Sphinx compatible files"""
|
"""Extract API documentation as Sphinx compatible files"""
|
||||||
|
|
||||||
def __init__(self, route):
|
def __init__(self, route):
|
||||||
self._documentation = route.get_documentation()
|
self._documentation = route.get_documentation()
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ class Response(aiohttp.web.Response):
|
|||||||
|
|
||||||
:param anwser The response as a Python object
|
:param anwser The response as a Python object
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def json(self, answer):
|
def json(self, answer):
|
||||||
"""Pass a Python object and return a JSON as answer"""
|
"""Pass a Python object and return a JSON as answer"""
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user