Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# Runs several checks
# * shellcheck for shell script correctness
# * shfmt for shell script formatting consistency
# * yapf for Python formatting consistency
# * several linters for Python consistency and correctness

name: Lint checks
on: [push, pull_request]
jobs:
python:
strategy:
fail-fast: false
matrix:
version: ['3.11', '3.10', '3.9', '3.8']
uses: ClangBuiltLinux/actions-workflows/.github/workflows/python_lint.yml@main
with:
python_version: ${{ matrix.version }}
shellcheck:
uses: ClangBuiltLinux/actions-workflows/.github/workflows/shellcheck.yml@main
shfmt:
uses: ClangBuiltLinux/actions-workflows/.github/workflows/shfmt.yml@main
yapf:
uses: ClangBuiltLinux/actions-workflows/.github/workflows/yapf.yml@main
15 changes: 6 additions & 9 deletions ci/install-vm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env python3 # pylint: disable=invalid-name

import argparse
import os
Expand All @@ -10,8 +10,7 @@

def parse_parameters():
parser = argparse.ArgumentParser(
description=
"Install a Fedora virtual machine using libvirt and virt-install.",
description="Install a Fedora virtual machine using virt-install.",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)

parser.add_argument("-c",
Expand Down Expand Up @@ -42,8 +41,7 @@ def check_requirements():
for command in ["virsh", "virt-install"]:
if not shutil.which(command):
raise RuntimeError(
"{} could not be found! Install and set up libvirt?".format(
command))
f"{command} could not be found! Install and set up libvirt?")

if not Path("/dev/kvm").exists():
raise RuntimeError(
Expand All @@ -63,20 +61,19 @@ def main():
cpu = "host"
console = "console=ttyS0"
else:
raise RuntimeError("This script does not support {}".format(host_arch))
raise RuntimeError(f"This script does not support {host_arch}")

virt_install = ["virt-install"]
virt_install += ["--boot", "uefi"]
virt_install += ["--connect", "qemu:///system"]
virt_install += ["--console", "pty,target_type=serial"]
virt_install += ["--cpu", cpu]
virt_install += ["--disk", "size={},format=qcow2".format(args.size)]
virt_install += ["--disk", f"size{args.size},format=qcow2"]
virt_install += ["--extra-args", console]
virt_install += ["--graphics", "none"]
virt_install += [
"--location",
"https://download.fedoraproject.org/pub/fedora/linux/releases/36/Server/{}/os"
.format(host_arch)
f"https://download.fedoraproject.org/pub/fedora/linux/releases/36/Server/{host_arch}/os"
]
# libvirt expects MiB; str cast here and '--vcpus' is to avoid:
# TypeError: expected str, bytes or os.PathLike object, not int
Expand Down