mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 11:18:11 +00:00
Apply pep8 fix
This commit is contained in:
parent
f01a6dcaaf
commit
da240f21ba
@ -57,4 +57,3 @@ class FileHandler:
|
|||||||
raise aiohttp.web.HTTPNotFound()
|
raise aiohttp.web.HTTPNotFound()
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
raise aiohttp.web.HTTPConflict(text=str(e))
|
raise aiohttp.web.HTTPConflict(text=str(e))
|
||||||
|
|
||||||
|
@ -16,7 +16,9 @@
|
|||||||
|
|
||||||
from ..web.route import Route
|
from ..web.route import Route
|
||||||
|
|
||||||
|
|
||||||
class IndexHandler:
|
class IndexHandler:
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@Route.get(
|
@Route.get(
|
||||||
r"/",
|
r"/",
|
||||||
|
@ -44,6 +44,7 @@ class Container(BaseVM):
|
|||||||
:param manager: Manager instance
|
:param manager: Manager instance
|
||||||
:param image: Docker image
|
:param image: Docker image
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, name, vm_id, project, manager, image, startcmd=None):
|
def __init__(self, name, vm_id, project, manager, image, startcmd=None):
|
||||||
self._name = name
|
self._name = name
|
||||||
self._id = vm_id
|
self._id = vm_id
|
||||||
|
@ -21,6 +21,7 @@ import hashlib
|
|||||||
import logging
|
import logging
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def md5sum(path):
|
def md5sum(path):
|
||||||
"""
|
"""
|
||||||
Return the md5sum of an image and cache it on disk
|
Return the md5sum of an image and cache it on disk
|
||||||
|
@ -104,6 +104,7 @@ def test_upload_previous_checksum(server, tmpdir):
|
|||||||
checksum = f.read()
|
checksum = f.read()
|
||||||
assert checksum == "ae187e1febee2a150b64849c32d566ca"
|
assert checksum == "ae187e1febee2a150b64849c32d566ca"
|
||||||
|
|
||||||
|
|
||||||
def test_upload_images_backup(server, tmpdir):
|
def test_upload_images_backup(server, tmpdir):
|
||||||
Config.instance().set("Server", "images_path", str(tmpdir / 'images'))
|
Config.instance().set("Server", "images_path", str(tmpdir / 'images'))
|
||||||
os.makedirs(str(tmpdir / 'images' / 'IOU'))
|
os.makedirs(str(tmpdir / 'images' / 'IOU'))
|
||||||
|
@ -242,7 +242,6 @@ def test_set_qemu_path_environ(vm, tmpdir, fake_qemu_binary):
|
|||||||
assert vm.platform == "x86_64"
|
assert vm.platform == "x86_64"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def test_set_qemu_path_windows(vm, tmpdir):
|
def test_set_qemu_path_windows(vm, tmpdir):
|
||||||
|
|
||||||
bin_path = os.path.join(os.environ["PATH"], "qemu-system-x86_64w.EXE")
|
bin_path = os.path.join(os.environ["PATH"], "qemu-system-x86_64w.EXE")
|
||||||
@ -255,7 +254,6 @@ def test_set_qemu_path_windows(vm, tmpdir):
|
|||||||
assert vm.platform == "x86_64"
|
assert vm.platform == "x86_64"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(sys.platform.startswith("linux") is False, reason="Supported only on linux")
|
@pytest.mark.skipif(sys.platform.startswith("linux") is False, reason="Supported only on linux")
|
||||||
def test_set_qemu_path_kvm_binary(vm, tmpdir, fake_qemu_binary):
|
def test_set_qemu_path_kvm_binary(vm, tmpdir, fake_qemu_binary):
|
||||||
|
|
||||||
|
@ -93,6 +93,7 @@ def parse_vmnet_range(start, end):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
class Range(argparse.Action):
|
class Range(argparse.Action):
|
||||||
|
|
||||||
def __call__(self, parser, args, values, option_string=None):
|
def __call__(self, parser, args, values, option_string=None):
|
||||||
if len(values) != 2:
|
if len(values) != 2:
|
||||||
raise argparse.ArgumentTypeError("vmnet range must consist of 2 numbers")
|
raise argparse.ArgumentTypeError("vmnet range must consist of 2 numbers")
|
||||||
|
Loading…
Reference in New Issue
Block a user