diff --git a/CHANGELOG b/CHANGELOG index b68a6d48..aeadeea7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -10,7 +10,7 @@ * Docker support * import / export portable projects (.gns3project) -## 1.4.6 28/04/2016 +## 1.4.6 28/04/2016 * More robust save/restore for VirtualBox linked clone VM hard disks. * Prevent non linked cloned hard disks to be detached when using VirtualBox linked cloned VMs. Fixes #1184. @@ -119,7 +119,7 @@ * Support VM usage for qemu * Raise an error if psutil version is invalid -## 1.4.0rc1 12/11/2015 +## 1.4.0rc1 12/11/2015 * Raise error if server received windows path * Update sentry key @@ -259,7 +259,7 @@ * Send an error when vmware executable cannot be found on Linux. Fixes #288. * Support for CPUs setting for Qemu VMs. -## 1.4.0alpha4 04/08/2015 +## 1.4.0alpha4 04/08/2015 * Quote command in qemu debug logs so you can copy/paste them * Support for Qemu disk interfaces, cd/dvd-rom image and boot priority. Fixes #278. @@ -267,11 +267,11 @@ * Catch GeneratorExit exception when trying to create a Ghost IOS image. * Backport: removes code that deletes IOS router instance files. -## 1.3.9 03/08/2015 +## 1.3.9 03/08/2015 * Backport: removes code that deletes IOS router instance files. -## 1.4.0alpha3 28/07/2015 +## 1.4.0alpha3 28/07/2015 * Raise error if qemu image already exist when creating disk * Prevent user to create a qemu to a different directory on non local server @@ -291,7 +291,7 @@ * Update documentation * API for listing current projects -## 1.3.8 27/07/2015 +## 1.3.8 27/07/2015 * Catch ProcessLookupError when updating iouyap config. Fixes #255. * Fixes IOS adapters and WICS cannot be removed. Fixes #282. @@ -308,7 +308,7 @@ * Backport from 1.4: Fixes RuntimeError: Event loop is closed. * Backport from 1.4: Bind host on 0.0.0.0 when checking for a free UDP port. -## 1.4.0alpha2 22/07/2015 +## 1.4.0alpha2 22/07/2015 * Deactivate uBridge process monitoring (process returns 1 on Windows when stopping). * Prevent using different hypervisors that leverage hardware virtualization. - Implemented for Qemu when a VMware or VirtualBox VM with hardware virtualization is already running. - Implemented for VirtualBox only when a Qemu VM with KVM is already running. @@ -363,15 +363,15 @@ * A notification stream with process monitoring * VMware support -## 1.3.7 22/06/2015 +## 1.3.7 22/06/2015 * Prevent install on Python 2 -## 1.3.6 16/06/2015 +## 1.3.6 16/06/2015 * Fix an issue with 1.4dev compatibility -## 1.3.5 16/06/15 +## 1.3.5 16/06/15 * Ignore invalid characters when reading the output of a process * Turn on / off authentication @@ -531,7 +531,7 @@ * Initialize chassis when creating an IOS router. Fixes #107. * Lock the dynamips reader an writer -## 1.3.0rc1 19/03/2015 +## 1.3.0rc1 19/03/2015 * Save IOS router config when saving the project * Look in legacy IOU images directory @@ -540,7 +540,7 @@ * Support all QEMU status * Bind tunnel UDP to the correct source index -## 1.3.0beta2 13/03/2015 +## 1.3.0beta2 13/03/2015 * Fixed issue when VBoxManage returns an error. * Server handler to shutdown a local server. @@ -550,7 +550,7 @@ * Alternative local server shutdown (intended for Windows). * Request user permission to kill the local server if it cannot be stopped. -## 1.3.0beta1 11/03/2015 +## 1.3.0beta1 11/03/2015 * Optional IOU license key check. * Relative path support of IOU, IOS and Qemu images. @@ -573,7 +573,7 @@ * Fixed Telnet server initialization issue in VirtualBox. * Disconnect network cable if adapter is not attached in VirtualBox vNIC. -## 1.3.0alpha1 03/03/2015 +## 1.3.0alpha1 03/03/2015 * HTTP Rest API instead of WebSocket * API documentation @@ -588,7 +588,7 @@ ## 1.2.2 2015/01/16 -### Small improvements / new features +### Small improvements / new features * Auxiliary console support for IOS routers. * Suspend / resume support for Qemu. @@ -620,7 +620,7 @@ * VirtualBox linked clones support (experimental, still some problems with temporary projects). -## 1.1 2014/10/23 +## 1.1 2014/10/23 * Serial console for local VirtualBox. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7d4747a6..74bba784 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,13 +18,13 @@ it on https://github.com/GNS3/gns3-gui we will take care of the triage. For bugs specific to the GNS3 VM, please report on https://github.com/GNS3/gns3-vm -## Asking for new features +## Asking for new features The best is to start a discussion on the community website in order to get feedback from the whole community. -## Contributing code +## Contributing code We welcome code contribution from everyone including beginners. Don't be afraid to submit a half finished or mediocre contribution and we will help you. @@ -45,6 +45,6 @@ The reason we do this is to ensure, to the extent possible, that we don’t “t More information there: https://github.com/GNS3/cla -### Pull requests +### Pull requests Creating a pull request is the easiest way to contribute code. Do not hesitate to create one early when contributing for new feature in order to get our feedback. diff --git a/docs/general.rst b/docs/general.rst index 6c86e228..e897fac4 100644 --- a/docs/general.rst +++ b/docs/general.rst @@ -29,7 +29,7 @@ You can check the server version with a simple curl command: .. code-block:: shell-session - # curl "http://localhost:3080/v2/version"" + # curl "http://localhost:3080/v1/version" { "version": "2.0.0dev1" } @@ -39,7 +39,7 @@ The next step is to create a project. .. code-block:: shell-session - # curl -X POST "http://localhost:3080/v2/projects" -d '{"name": "test"}' + # curl -X POST "http://localhost:3080/v1/projects" -d '{"name": "test"}' { "name": "test", "path": null, @@ -51,7 +51,7 @@ With this project id we can now create two VPCS Node. .. code-block:: shell-session - # curl -X POST "http://localhost:3080/v2/projects/994d95b6-7dd4-467b-898c-14cf34900b7b/vms" -d '{"name": "VPCS 1", "vm_type": "vpcs"}' + # curl -X POST "http://localhost:3080/v1/projects/42f9feee-3217-4104-981e-85d5f0a806ec/vpcs/vms" -d '{"name": "VPCS 1"}' { "console": 2000, "name": "VPCS 1", @@ -59,7 +59,7 @@ With this project id we can now create two VPCS Node. "vm_id": "24d2e16b-fbef-4259-ae34-7bc21a41ee28" }% - # curl -X POST "http://localhost:3080/v1/projects/42f9feee-3217-4104-981e-85d5f0a806ec/vpcs/vms" -d '{"name": "VPCS 2"}' + # curl -X POST "http://localhost:3080/v1/projects/42f9feee-3217-4104-981e-85d5f0a806ec/vpcs/vms" -d '{"name": "VPCS 2"}' { "console": 2001, "name": "VPCS 2", @@ -87,7 +87,7 @@ communication is made by creating two UDP tunnels. .. code-block:: shell-session - # curl -X POST "http://localhost:3080/v1/projects/42f9feee-3217-4104-981e-85d5f0a806ec/vpcs/vms/24d2e16b-fbef-4259-ae34-7bc21a41ee28/adapters/0/ports/0/nio" -d '{"lport": 10000, "rhost": "127.0.0.1", "rport": 10001, "type": "nio_udp"}' + # curl -X POST "http://localhost:3080/v1/projects/42f9feee-3217-4104-981e-85d5f0a806ec/vpcs/vms/24d2e16b-fbef-4259-ae34-7bc21a41ee28/adapters/0/ports/0/nio" -d '{"lport": 10000, "rhost": "127.0.0.1", "rport": 10001, "type": "nio_udp"}' { "lport": 10000, "rhost": "127.0.0.1", @@ -107,7 +107,7 @@ Now we can start the two Node .. code-block:: shell-session - # curl -X POST "http://localhost:3080/v1/projects/42f9feee-3217-4104-981e-85d5f0a806ec/vpcs/vms/24d2e16b-fbef-4259-ae34-7bc21a41ee28/start" -d "{}" + # curl -X POST "http://localhost:3080/v1/projects/42f9feee-3217-4104-981e-85d5f0a806ec/vpcs/vms/24d2e16b-fbef-4259-ae34-7bc21a41ee28/start" -d "{}" # curl -X POST "http://localhost:3080/v1/projects/42f9feee-3217-4104-981e-85d5f0a806ec/vpcs/vms/daefc24a-103c-4717-8e01-6517d931c1ae/start" -d '{}' Everything should be started now. You can connect via telnet to the different Node. @@ -115,7 +115,7 @@ The port is the field console in the create Node request. .. code-block:: shell-session - # telnet 127.0.0.1 2000 + # telnet 127.0.0.1 2000 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. @@ -141,7 +141,7 @@ The port is the field console in the create Node request. Good-bye Connection closed by foreign host. - # telnet 127.0.0.1 2001 + # telnet 127.0.0.1 2001 telnet 127.0.0.1 2001 Trying 127.0.0.1... Connected to localhost. @@ -217,5 +217,5 @@ Previous versions API version 1 ------------- -Shipped with GNS3 1.3 and 1.4. This API doesn't support the controller system. +Shipped with GNS3 1.3, 1.4 and 1.5. This API doesn't support the controller system. diff --git a/gns3server/compute/base_manager.py b/gns3server/compute/base_manager.py index 939e5eff..cf7f7218 100644 --- a/gns3server/compute/base_manager.py +++ b/gns3server/compute/base_manager.py @@ -424,7 +424,7 @@ class BaseManager: return force_unix_path(path) else: - # For non local server we disallow using absolute path outside image directory + # For non local server we disallow using absolute path outside image directory if Config.instance().get_section_config("Server").get("local", False) is False: img_directory = self.config.get_section_config("Server").get("images_path", os.path.expanduser("~/GNS3/images")) img_directory = force_unix_path(img_directory) diff --git a/gns3server/compute/base_node.py b/gns3server/compute/base_node.py index 9dca77cb..492f9ab4 100644 --- a/gns3server/compute/base_node.py +++ b/gns3server/compute/base_node.py @@ -70,7 +70,7 @@ class BaseNode: else: self._console = self._manager.port_manager.reserve_tcp_port(self._console, self._project) - # We need to allocate aux before giving a random console port + # We need to allocate aux before giving a random console port if self._aux is not None: self._aux = self._manager.port_manager.reserve_tcp_port(self._aux, self._project) diff --git a/gns3server/compute/docker/__init__.py b/gns3server/compute/docker/__init__.py index 2c499b98..fc488a93 100644 --- a/gns3server/compute/docker/__init__.py +++ b/gns3server/compute/docker/__init__.py @@ -116,11 +116,11 @@ class Docker(BaseManager): pass log.debug("Query Docker %s %s params=%s data=%s Response: %s", method, path, params, data, body) if response.status == 304: - raise DockerHttp304Error("Docker has returned an error: {} {}".format(response.status, body)) + raise DockerHttp304Error("Docker has returned an error: {} {}".format(response.status, body)) elif response.status == 404: - raise DockerHttp404Error("Docker has returned an error: {} {}".format(response.status, body)) + raise DockerHttp404Error("Docker has returned an error: {} {}".format(response.status, body)) else: - raise DockerError("Docker has returned an error: {} {}".format(response.status, body)) + raise DockerError("Docker has returned an error: {} {}".format(response.status, body)) return response @asyncio.coroutine diff --git a/gns3server/compute/docker/docker_vm.py b/gns3server/compute/docker/docker_vm.py index a6097b24..db1404c1 100644 --- a/gns3server/compute/docker/docker_vm.py +++ b/gns3server/compute/docker/docker_vm.py @@ -368,7 +368,7 @@ class DockerVM(BaseNode): """ # We can not use the API because docker doesn't expose a websocket api for exec - # https://github.com/GNS3/gns3-gui/issues/1039 + # https://github.com/GNS3/gns3-gui/issues/1039 process = yield from asyncio.subprocess.create_subprocess_exec( "docker", "exec", "-i", self._cid, "/gns3/bin/busybox", "script", "-qfc", "/gns3/bin/busybox sh", "/dev/null", stdout=asyncio.subprocess.PIPE, diff --git a/gns3server/compute/docker/resources/init.sh b/gns3server/compute/docker/resources/init.sh index a72d1c26..0d67def1 100755 --- a/gns3server/compute/docker/resources/init.sh +++ b/gns3server/compute/docker/resources/init.sh @@ -17,7 +17,7 @@ # # This script is injected into the container and launch before -# the start command of the container +# the start command of the container # OLD_PATH="$PATH" PATH=/gns3/bin:/tmp/gns3/bin diff --git a/gns3server/compute/dynamips/__init__.py b/gns3server/compute/dynamips/__init__.py index c0dcf48a..70ac1d1f 100644 --- a/gns3server/compute/dynamips/__init__.py +++ b/gns3server/compute/dynamips/__init__.py @@ -218,7 +218,7 @@ class Dynamips(BaseManager): continue # Release the dynamips ids if we want to reload the same project - # later + # later if project.id in self._dynamips_ids: del self._dynamips_ids[project.id] diff --git a/gns3server/compute/iou/iou_vm.py b/gns3server/compute/iou/iou_vm.py index ad3647e0..0e847c3e 100644 --- a/gns3server/compute/iou/iou_vm.py +++ b/gns3server/compute/iou/iou_vm.py @@ -131,7 +131,7 @@ class IOUVM(BaseNode): self._path = self.manager.get_abs_image_path(path) # In 1.2 users uploaded images to the images roots - # after the migration their images are inside images/IOU + # after the migration their images are inside images/IOU # but old topologies use old path if "IOU" not in self._path: location, filename = os.path.split(self._path) diff --git a/gns3server/compute/project.py b/gns3server/compute/project.py index 1c1d2d61..3619576e 100644 --- a/gns3server/compute/project.py +++ b/gns3server/compute/project.py @@ -484,7 +484,7 @@ class Project: if os.path.split(root)[-1:][0] == "project-files": dirs[:] = [d for d in dirs if d not in ("snapshots", "tmp")] - # Ignore log files and OS noise + # Ignore log files and OS noise files = [f for f in files if not f.endswith('_log.txt') and not f.endswith('.log') and f != '.DS_Store'] for file in files: diff --git a/gns3server/compute/qemu/qemu_vm.py b/gns3server/compute/qemu/qemu_vm.py index 820a9824..2d4d9bcc 100644 --- a/gns3server/compute/qemu/qemu_vm.py +++ b/gns3server/compute/qemu/qemu_vm.py @@ -82,8 +82,8 @@ class QemuVM(BaseNode): try: self.qemu_path = qemu_path except QemuError as e: - # If the binary is not found for topologies 1.4 and later - # search via the platform otherwise use the binary name + # If the binary is not found for topologies 1.4 and later + # search via the platform otherwise use the binary name if platform: self.platform = platform else: diff --git a/gns3server/compute/virtualbox/__init__.py b/gns3server/compute/virtualbox/__init__.py index 5b006d1b..e794730a 100644 --- a/gns3server/compute/virtualbox/__init__.py +++ b/gns3server/compute/virtualbox/__init__.py @@ -83,8 +83,8 @@ class VirtualBox(BaseManager): @asyncio.coroutine def execute(self, subcommand, args, timeout=60): - # We use a lock prevent parallel execution due to strange errors - # reported by a user and reproduced by us. + # We use a lock prevent parallel execution due to strange errors + # reported by a user and reproduced by us. # https://github.com/GNS3/gns3-gui/issues/261 with (yield from self._execute_lock): vboxmanage_path = self.vboxmanage_path diff --git a/gns3server/crash_report.py b/gns3server/crash_report.py index 7d1aea77..60981e4c 100644 --- a/gns3server/crash_report.py +++ b/gns3server/crash_report.py @@ -36,7 +36,7 @@ import logging log = logging.getLogger(__name__) -# Dev build +# Dev build if __version_info__[3] != 0: import faulthandler diff --git a/gns3server/handlers/api/compute/project_handler.py b/gns3server/handlers/api/compute/project_handler.py index 2690c161..b2615bb0 100644 --- a/gns3server/handlers/api/compute/project_handler.py +++ b/gns3server/handlers/api/compute/project_handler.py @@ -233,7 +233,7 @@ class ProjectHandler: :returns: hash """ stats = {} - # Non blocking call in order to get cpu usage. First call will return 0. + # Non blocking call in order to get cpu usage. First call will return 0 stats["cpu_usage_percent"] = psutil.cpu_percent(interval=None) stats["memory_usage_percent"] = psutil.virtual_memory().percent return {"action": "ping", "event": stats} @@ -275,7 +275,11 @@ class ProjectHandler: path = request.match_info["path"] path = os.path.normpath(path) +<< << << < HEAD: gns3server / handlers / api / compute / project_handler.py # Raise an error if user try to escape +== == == = + # Raise error if user try to escape +>>>>>> > 1.5: gns3server / handlers / api / project_handler.py if path[0] == ".": raise aiohttp.web.HTTPForbidden path = os.path.join(project.path, path) @@ -362,7 +366,7 @@ class ProjectHandler: path = request.match_info["path"] path = os.path.normpath(path) - # Raise error if user try to escape + # Raise error if user try to escape if path[0] == ".": raise aiohttp.web.HTTPForbidden path = os.path.join(project.path, path) @@ -428,9 +432,17 @@ class ProjectHandler: project_id = request.match_info["project_id"] project = pm.create_project(project_id=project_id) +<<<<<<< HEAD:gns3server/handlers/api/compute/project_handler.py # We write the content to a temporary location and after we extract it all. # It could be more optimal to stream this but it is not implemented in Python. # Spooled means the file is temporary kept in memory until max_size is reached +======= + # We write the content to a temporary location + # and after extract all. It could be more optimal to stream + # this but it's not implemented in Python. + # + # Spooled mean the file is temporary keep in ram until max_size +>>>>>>> 1.5:gns3server/handlers/api/project_handler.py try: with tempfile.SpooledTemporaryFile(max_size=10000) as temp: while True: diff --git a/gns3server/utils/__init__.py b/gns3server/utils/__init__.py index 124a9c37..9f8ea4a7 100644 --- a/gns3server/utils/__init__.py +++ b/gns3server/utils/__init__.py @@ -73,7 +73,7 @@ def parse_version(version): version.append("00000") if len(version) == 2: version.append("000000") - # We want rc to be at lower level than dev version + # We want rc to be at lower level than dev version if info == 'rc': info = 'c' version.append(info) diff --git a/gns3server/utils/asyncio/__init__.py b/gns3server/utils/asyncio/__init__.py index 3d2f2017..fc0c2d00 100644 --- a/gns3server/utils/asyncio/__init__.py +++ b/gns3server/utils/asyncio/__init__.py @@ -54,7 +54,7 @@ def subprocess_check_output(*args, cwd=None, env=None): if output is None: return "" # If we received garbage we ignore invalid characters - # it should happend only when user try to use another binary + # it should happend only when user try to use another binary # and the code of VPCS, dynamips... Will detect it's not the correct binary return output.decode("utf-8", errors="ignore") diff --git a/gns3server/utils/asyncio/telnet_server.py b/gns3server/utils/asyncio/telnet_server.py index c58af69d..e28f622a 100644 --- a/gns3server/utils/asyncio/telnet_server.py +++ b/gns3server/utils/asyncio/telnet_server.py @@ -69,7 +69,7 @@ class AsyncioTelnetServer: self._binary = binary # If echo is true when the client send data - # the data is echo on his terminal by telnet otherwise + # the data is echo on his terminal by telnet otherwise # it's our job (or the wrapped app) to send back the data self._echo = echo diff --git a/gns3server/web/logger.py b/gns3server/web/logger.py index ba5c4736..e34b37b0 100644 --- a/gns3server/web/logger.py +++ b/gns3server/web/logger.py @@ -74,7 +74,7 @@ class ColouredStreamHandler(logging.StreamHandler): stream.write(msg) stream.write(self.terminator) self.flush() - # On OSX when frozen flush raise a BrokenPipeError + # On OSX when frozen flush raise a BrokenPipeError except BrokenPipeError: pass except Exception: diff --git a/scripts/remote-install.sh b/scripts/remote-install.sh index 2ccba8a1..d92bc773 100644 --- a/scripts/remote-install.sh +++ b/scripts/remote-install.sh @@ -18,7 +18,7 @@ # # Install GNS3 on a remote Ubuntu 14.04 LTS server # This create a dedicated user and setup all the package -# and optionnaly a VPN +# and optionnaly a VPN # function help { @@ -115,7 +115,7 @@ apt-get update log "Upgrade packages" apt-get upgrade -y -log " Install GNS3 packages" +log " Install GNS3 packages" apt-get install -y gns3-server log "Create user GNS3 with /opt/gns3 as home directory" diff --git a/tests/compute/docker/test_docker_vm.py b/tests/compute/docker/test_docker_vm.py index fdd34255..1be32d63 100644 --- a/tests/compute/docker/test_docker_vm.py +++ b/tests/compute/docker/test_docker_vm.py @@ -684,7 +684,7 @@ def test_add_ubridge_connection_no_free_interface(loop, vm): nio = vm.manager.create_nio(0, nio) with pytest.raises(DockerError): - # We create fake ethernet interfaces for docker + # We create fake ethernet interfaces for docker interfaces = ["veth-gns3-ext{}".format(index) for index in range(128)] with patch("psutil.net_if_addrs", return_value=interfaces): diff --git a/tests/compute/iou/test_iou_vm.py b/tests/compute/iou/test_iou_vm.py index 9e0d4cee..3a694cb4 100644 --- a/tests/compute/iou/test_iou_vm.py +++ b/tests/compute/iou/test_iou_vm.py @@ -216,7 +216,7 @@ def test_path(vm, fake_iou_bin): def test_path_12_location(vm, fake_iou_bin): # In 1.2 users uploaded images to the images roots - # after the migration their images are inside images/IOU + # after the migration their images are inside images/IOU # but old topologies use old path with patch("gns3server.config.Config.get_section_config", return_value={"local": True}): vm.path = fake_iou_bin.replace("/IOU", "")