osbuild: run isort on all files

This commit is contained in:
Simon de Vlieger 2022-08-17 11:28:27 +02:00
parent 98daf1a87d
commit ea6085fae6
174 changed files with 106 additions and 257 deletions

View file

@ -1 +1 @@
1be3f1bfb671fa6d59dcd2203f23e1625194574b
c3385b6562b83e2cfc5cf93d5eddcb38e8eba02e

View file

@ -11,7 +11,6 @@ import sys
import osbuild.api
SCHEMA = """
"additionalProperties": false,
"properties": {

View file

@ -12,7 +12,6 @@ import sys
import osbuild.api
SCHEMA = """
"additionalProperties": false
"""

View file

@ -30,7 +30,6 @@ import tempfile
import osbuild.api
DEFAULT_PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

View file

@ -28,7 +28,6 @@ import tempfile
from osbuild import api
from osbuild.util import ostree
CAPABILITIES = ["CAP_MAC_ADMIN", "CAP_NET_ADMIN", "CAP_SYS_PTRACE"]

View file

@ -28,12 +28,11 @@ import struct
import subprocess
import sys
import tempfile
from typing import List, BinaryIO, Optional
from typing import BinaryIO, List, Optional
import osbuild.api
import osbuild.remoteloop as remoteloop
SCHEMA = """
"additionalProperties": false,
"required": ["format", "filename", "ptuuid", "size"],

View file

@ -28,7 +28,6 @@ import sys
import osbuild.api
import osbuild.remoteloop as remoteloop
SCHEMA = """
"additionalProperties": false,
"required": ["filename", "root_fs_uuid", "size"],

View file

@ -26,7 +26,6 @@ import sys
import osbuild.api
CAPABILITIES = ["CAP_MAC_ADMIN"]

View file

@ -10,7 +10,6 @@ independent of osbuild but used across the osbuild codebase.
from .pipeline import Manifest, Pipeline, Stage
__version__ = "67"
__all__ = [

View file

@ -8,7 +8,6 @@ import sys
from osbuild.main_cli import osbuild_cli as main
if __name__ == "__main__":
r = main()
sys.exit(r)

View file

@ -6,12 +6,12 @@ import json
import os
import sys
import tempfile
import traceback
import threading
import traceback
from typing import Dict, Optional
from .util.types import PathLike
from .util import jsoncomm
from .util import jsoncomm
from .util.types import PathLike
__all__ = [
"API"

View file

@ -15,13 +15,11 @@ import stat
import subprocess
import tempfile
import time
from typing import Optional, Set
from osbuild.api import BaseAPI
from osbuild.util import linux
__all__ = [
"BuildRoot",
]

View file

@ -16,8 +16,7 @@ import abc
import hashlib
import json
import os
from typing import Dict, Optional, Any
from typing import Any, Dict, Optional
from osbuild import host

View file

@ -7,10 +7,11 @@ the created tree into an artefact. The pipeline can have any
number of nested build pipelines. A sources section is used
to fetch resources.
"""
from typing import Dict, Any
from osbuild.meta import Index, ValidationResult
from ..pipeline import BuildResult, Manifest, Pipeline, detect_host_runner
from typing import Any, Dict
from osbuild.meta import Index, ValidationResult
from ..pipeline import BuildResult, Manifest, Pipeline, detect_host_runner
VERSION = "1"

View file

@ -2,13 +2,14 @@
Second, and current, version of the manifest description
"""
from typing import Dict, Any
from typing import Any, Dict
from osbuild.meta import Index, ModuleInfo, ValidationResult
from ..inputs import Input
from ..pipeline import Manifest, Pipeline, Stage, detect_host_runner
from ..sources import Source
VERSION = "2"

View file

@ -48,7 +48,7 @@ import sys
import threading
import traceback
from collections import OrderedDict
from typing import Any, Dict, List, Optional, Tuple, Callable, Iterable, Union
from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union
from osbuild.util.jsoncomm import FdSet, Socket

View file

@ -20,11 +20,11 @@ import abc
import hashlib
import json
import os
from typing import Dict, Optional, Tuple, Any
from typing import Any, Dict, Optional, Tuple
from osbuild import host
from osbuild.util.types import PathLike
from .objectstore import StoreClient, StoreServer

View file

@ -24,16 +24,16 @@ import ast
import contextlib
import copy
import importlib.util
import json
import os
import pkgutil
import json
import sys
from collections import deque
from typing import Dict, Sequence, List, Optional, Union, Set, Deque, Any, Tuple
from typing import (Any, Deque, Dict, List, Optional, Sequence, Set, Tuple,
Union)
import jsonschema
FAILED_TITLE = "JSON Schema validation failed"
FAILED_TYPEURI = "https://osbuild.org/validation-error"

View file

@ -13,7 +13,6 @@ import json
import os
import sys
import time
from typing import Dict
import osbuild

View file

@ -12,7 +12,6 @@ import hashlib
import json
import os
import subprocess
from typing import Dict, List
from osbuild import host

View file

@ -3,13 +3,13 @@ import os
import subprocess
import tempfile
import uuid
from typing import Optional, Iterator, Set
from typing import Iterator, Optional, Set
from osbuild.util.types import PathLike
from osbuild.util import jsoncomm, rmrf
from osbuild.util.mnt import mount, umount
from . import api
from osbuild.util.types import PathLike
from . import api
__all__ = [
"ObjectStore",

View file

@ -5,18 +5,14 @@ import json
import os
from typing import Dict, Generator, Iterable, Iterator, List, Optional
from . import buildroot, host, objectstore, remoteloop
from .api import API
from . import buildroot
from . import host
from . import objectstore
from . import remoteloop
from .devices import Device, DeviceManager
from .inputs import Input, InputManager
from .mounts import Mount, MountManager
from .objectstore import ObjectStore
from .sources import Source
from .util import osrelease
from .objectstore import ObjectStore
DEFAULT_CAPABILITIES = {
"CAP_AUDIT_WRITE",

View file

@ -1,8 +1,8 @@
import contextlib
import errno
import os
from . import api
from . import loop
from . import api, loop
from .util import jsoncomm
__all__ = [

View file

@ -1,9 +1,9 @@
import abc
import contextlib
import os
import json
import tempfile
import concurrent.futures
import contextlib
import json
import os
import tempfile
from abc import abstractmethod
from typing import Dict, Tuple

View file

@ -7,7 +7,6 @@ import os
from .types import PathLike
# How many bytes to read in one go. Taken from coreutils/gnulib
BLOCKSIZE = 32768

View file

@ -7,7 +7,6 @@ library.
import contextlib
__all__ = [
"suppress_oserror",
]

View file

@ -12,8 +12,8 @@ import errno
import json
import os
import socket
from typing import Any
from typing import Optional
from typing import Any, Optional
from .types import PathLike

View file

@ -20,7 +20,6 @@ import os
import platform
import threading
__all__ = [
"ioctl_get_immutable",
"ioctl_toggle_immutable",

View file

@ -15,8 +15,7 @@ import re
import shlex
import shutil
import subprocess
from typing import Dict, Any
from typing import Any, Dict
import mako.template

View file

@ -26,9 +26,8 @@ import os
import re
import struct
import sys
from collections import OrderedDict
from typing import BinaryIO, Dict, Union, List
from typing import BinaryIO, Dict, List, Union
PathLike = Union[str, bytes, os.PathLike]

View file

@ -6,7 +6,6 @@ related documentation can be found in `os-release(5)`.
import os
# The default paths where os-release is located, as per os-release(5)
DEFAULT_PATHS = [
"/etc/os-release",

View file

@ -6,8 +6,7 @@ import subprocess
import sys
import tempfile
import typing
from typing import List, Any
from typing import Any, List
from .types import PathLike

View file

@ -16,7 +16,6 @@ import shutil
import osbuild.util.linux as linux
__all__ = [
"rmtree",
]

View file

@ -3,7 +3,6 @@
import errno
import os
import subprocess
from typing import Dict, TextIO
# Extended attribute name for SELinux labels

View file

@ -1,7 +1,6 @@
"""Wrapper module for output formatting."""
import sys
from typing import Dict

View file

@ -3,7 +3,6 @@
import contextlib
import pathlib
# The default lock dir to use
LOCKDIR = "/run/osbuild/locks/udev"

View file

@ -3,7 +3,6 @@
import subprocess
import sys
if __name__ == "__main__":
r = subprocess.run(sys.argv[1:], check=False)
sys.exit(r.returncode)

View file

@ -20,11 +20,9 @@ import tempfile
import urllib.parse
from osbuild import sources
from osbuild.util.checksum import verify_file
from osbuild.util.rhsm import Subscriptions
SCHEMA = """
"additionalProperties": false,
"definitions": {

View file

@ -19,7 +19,6 @@ import sys
from osbuild import sources
from osbuild.util.checksum import verify_file
SCHEMA = """
"definitions": {
"item": {

View file

@ -8,13 +8,12 @@ gpg keys are provided via `gpgkeys`.
import os
import sys
import subprocess
import sys
import uuid
from osbuild.util.ostree import show
from osbuild import sources
from osbuild.util.ostree import show
SCHEMA = """
"additionalProperties": false,

View file

@ -5,11 +5,11 @@ Buildhost commands used: `skopeo`.
"""
import errno
import os
import sys
import subprocess
import tempfile
import hashlib
import os
import subprocess
import sys
import tempfile
from osbuild import sources
from osbuild.util import ctx

View file

@ -12,10 +12,8 @@ configurable via the `kickstart-modules` option.
import os
import sys
import osbuild.api
SCHEMA = """
"additionalProperties": true,
"required": ["kickstart-modules"],

View file

@ -16,7 +16,6 @@ import sys
import osbuild.api
SCHEMA = """
"additionalProperties": false,
"description": "Configure authentication sources."

View file

@ -20,7 +20,6 @@ import sys
import osbuild.api
SCHEMA = """
"additionalProperties": false,
"required": ["profile"],

View file

@ -30,10 +30,9 @@ import shutil
import subprocess
import sys
import tempfile
import osbuild.remoteloop as remoteloop
import osbuild.api
import osbuild.remoteloop as remoteloop
SCHEMA_2 = """
"options": {

View file

@ -11,7 +11,6 @@ import sys
import osbuild.api
SCHEMA = """
"additionalProperties": true,
"required": ["arch", "product", "version", "final"],

View file

@ -35,12 +35,11 @@ Constraints:
"""
import sys
import re
import sys
import osbuild.api
SCHEMA = """
"additionalProperties": false,
"oneOf": [

View file

@ -10,10 +10,8 @@ import os
import subprocess
import sys
import osbuild.api
SCHEMA_2 = r"""
"devices": {
"type": "object",

View file

@ -17,12 +17,11 @@ Currently supported subset of cloud-init configuration:
import sys
import yaml
import osbuild.api
SCHEMA = r"""
"definitions": {
"reporting_handlers": {

View file

@ -17,10 +17,8 @@ try:
except ModuleNotFoundError:
import pytoml as toml
import osbuild.api
SCHEMA = r"""
"definitions": {
"storage": {

View file

@ -14,13 +14,11 @@ the directory itself.
import os
import subprocess
import sys
from typing import Dict
from urllib.parse import urlparse, ParseResult
from urllib.parse import ParseResult, urlparse
import osbuild.api
CAPABILITIES = ["CAP_MAC_ADMIN"]

View file

@ -17,7 +17,6 @@ import sys
import osbuild.api
SCHEMA_2 = r"""
"options": {
"additionalProperties": false,

View file

@ -18,7 +18,6 @@ import sys
import osbuild.api
SCHEMA = """
"additionalProperties": false,
"required": ["volumes"],

View file

@ -14,7 +14,6 @@ import sys
import osbuild.api
SCHEMA = """
"additionalProperties": false,
"required": ["tty"],

View file

@ -6,12 +6,11 @@ This will create a `.discinfo` file with the specified parameters.
"""
import os
import time
import sys
import time
import osbuild.api
SCHEMA = """
"additionalProperties": true,
"required": ["basearch", "release"],

View file

@ -11,11 +11,11 @@ a subset of options can be set:
import sys
import iniparse
import osbuild.api
SCHEMA = r"""
"definitions": {
"commands": {

View file

@ -12,11 +12,11 @@ for details about the configuration options.
import os
import sys
import iniparse
import osbuild.api
SCHEMA = r"""
"definitions": {
"variable": {

View file

@ -17,7 +17,6 @@ import sys
import osbuild.api
SCHEMA = """
"required": ["kernel"],
"properties": {

View file

@ -28,7 +28,6 @@ import sys
import osbuild.api
SCHEMA = r"""
"additionalProperties": false,
"required": ["config", "filename"],

View file

@ -11,7 +11,6 @@ import sys
import osbuild.api
SCHEMA = """
"additionalProperties": false,
"properties": {

View file

@ -7,13 +7,12 @@ This will create a '/fdo_diun_root_certs.pem' with content
specified via the `rootcerts` input.
"""
import shutil
import os
import shutil
import sys
import osbuild.api
SCHEMA_2 = r"""
"inputs": {
"type": "object",

View file

@ -31,7 +31,6 @@ import sys
import osbuild.api
SCHEMA = """
"additionalProperties": false,
"properties": {

View file

@ -21,7 +21,6 @@ import sys
import osbuild.api
SCHEMA = """
"additionalProperties": false,
"required": ["commands"],

View file

@ -24,7 +24,6 @@ import sys
import osbuild.api
SCHEMA = """
"additionalProperties": false,
"properties": {

View file

@ -17,7 +17,6 @@ import sys
import osbuild.api
from osbuild.util import ostree
SCHEMA = """
"additionalProperties": false,
"required": ["filesystems"],

View file

@ -18,7 +18,6 @@ import iniparse
import osbuild.api
SCHEMA = r"""
"definitions": {
"Accounts": {

View file

@ -10,7 +10,6 @@ import sys
import osbuild.api
SCHEMA = """
"additionalProperties": false,
"required": ["config"],

View file

@ -16,7 +16,6 @@ import sys
import osbuild.api
SCHEMA = """
"additionalProperties": false,
"properties": {

View file

@ -82,7 +82,6 @@ import sys
import osbuild.api
SCHEMA = """
"additionalProperties": false,
"oneOf": [{

View file

@ -42,16 +42,14 @@ image and transfers control to it.
import os
import subprocess
import shutil
import struct
import subprocess
import sys
from typing import BinaryIO, Dict
import osbuild.api
SCHEMA = r"""
"definitions": {
"core-mkimage": {

View file

@ -7,10 +7,10 @@ an efiboot.img.
import os
import shutil
import sys
import string
import osbuild.api
import sys
import osbuild.api
SCHEMA_2 = """
"options": {

View file

@ -45,7 +45,6 @@ import sys
import osbuild.api
SCHEMA = """
"definitions": {

View file

@ -11,7 +11,6 @@ import sys
import osbuild.api
SCHEMA_2 = r"""
"inputs": {
"type": "object",

View file

@ -11,7 +11,6 @@ import sys
import osbuild.api
SCHEMA_2 = r"""
"inputs": {
"type": "object",

View file

@ -16,7 +16,6 @@ import sys
import osbuild.api
SCHEMA = """
"additionalProperties": false,
"required": ["hostname"],

View file

@ -21,7 +21,6 @@ import sys
import osbuild.api
STAGE_OPTS = """
"properties": {
"network": {

View file

@ -12,7 +12,6 @@ import sys
import osbuild.api
SCHEMA = """
"additionalProperties": false,
"required": ["filename"],

View file

@ -6,10 +6,10 @@ Create an isolinux bootloader
import os
import shutil
import sys
import string
import osbuild.api
import sys
import osbuild.api
SCHEMA_2 = """
"options": {

View file

@ -14,7 +14,6 @@ import sys
import osbuild.api
SCHEMA = """
"additionalProperties": false,
"properties": {

View file

@ -18,13 +18,12 @@ Valid keymaps are generally found in /lib/kbd/keymaps.
"""
import os
import subprocess
import sys
import os
import osbuild.api
SCHEMA = """
"additionalProperties": false,
"required": ["keymap"],

View file

@ -10,14 +10,12 @@ Only a very limited set of available kickstart
commands are supported here.
"""
import sys
import os
import sys
from typing import Dict, List
import osbuild.api
SCHEMA = """
"additionalProperties": false,
"required": ["path"],

View file

@ -11,13 +11,12 @@ target system with `LANG={language}`.
"""
import os
import subprocess
import sys
import os
import osbuild.api
SCHEMA = """
"additionalProperties": false,
"required": ["language"],

View file

@ -20,10 +20,8 @@ import collections
import os
import sys
from osbuild.util.lorax import render_template, Script
import osbuild.api
from osbuild.util.lorax import Script, render_template
SCHEMA = """
"additionalProperties": false,

View file

@ -17,10 +17,8 @@ import os
import subprocess
import sys
import osbuild.api
SCHEMA_2 = r"""
"definitions": {
"pbkdf2": {

View file

@ -10,10 +10,8 @@ import os
import subprocess
import sys
import osbuild.api
SCHEMA_2 = r"""
"devices": {
"type": "object",

View file

@ -15,10 +15,8 @@ import subprocess
import sys
import uuid
import osbuild.api
SCHEMA_2 = r"""
"devices": {
"type": "object",

View file

@ -12,7 +12,6 @@ import sys
import osbuild.api
from osbuild.util.path import in_tree
SCHEMA_2 = r"""
"options": {
"additionalProperties": false,

View file

@ -11,10 +11,8 @@ Buildhost commands used: `mkfs.btrfs`.
import subprocess
import sys
import osbuild.api
SCHEMA_2 = r"""
"devices": {
"type": "object",

View file

@ -11,10 +11,8 @@ Buildhost commands used: `mke2fs`.
import subprocess
import sys
import osbuild.api
SCHEMA_2 = r"""
"devices": {
"type": "object",

View file

@ -15,10 +15,8 @@ Buildhost commands used: `mkfs.fat`.
import subprocess
import sys
import osbuild.api
SCHEMA_2 = r"""
"devices": {
"type": "object",

View file

@ -11,10 +11,8 @@ Buildhost commands used: `mkfs.xfs`.
import subprocess
import sys
import osbuild.api
SCHEMA_2 = r"""
"devices": {
"type": "object",

View file

@ -22,7 +22,6 @@ import sys
import osbuild.api
SCHEMA = r"""
"additionalProperties": false,
"required": ["commands", "filename"],

View file

@ -25,7 +25,6 @@ import sys
import osbuild.api
SCHEMA = r"""
"definitions": {
"device-list": {

View file

@ -13,13 +13,12 @@ and here only a subset of the available options. See the schema
for more information.
"""
import configparser
import os
import sys
import configparser
import osbuild.api
SCHEMA = r"""
"definitions": {
"connection": {

View file

@ -12,7 +12,6 @@ import sys
import osbuild.api
SCHEMA_2 = """
"options": {
"additionalProperties": true

View file

@ -38,16 +38,15 @@ podman[3] with `podman pull oci-archive:<archive>`.
import datetime
import time
import json
import os
import subprocess
import sys
import tempfile
import time
import osbuild.api
DEFAULT_PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

View file

@ -19,7 +19,6 @@ import sys
import osbuild.api
SCHEMA = """
"additionalProperties": false,
"required": ["config"],

View file

@ -22,8 +22,8 @@ the sysroot and the deployments. Additional kernel options can be passed via
import os
import sys
import subprocess
import sys
import osbuild.api
from osbuild.util import selinux

View file

@ -23,7 +23,6 @@ import tempfile
from osbuild import api
from osbuild.util import ostree
CAPABILITIES = ["CAP_MAC_ADMIN", "CAP_NET_ADMIN", "CAP_SYS_PTRACE"]

View file

@ -11,12 +11,11 @@ See `ostree.repo-config(5)` for more information.
"""
import os
import sys
import subprocess
import sys
import osbuild.api
SCHEMA = """
"additionalProperties": false,
"required": ["repo"],

Some files were not shown because too many files have changed in this diff Show more