Skip to content

Commit 4a5fcef

Browse files
committed
Resolve linter complaints
1 parent c30e5a9 commit 4a5fcef

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

mkosi/__init__.py

+4-13
Original file line numberDiff line numberDiff line change
@@ -2784,11 +2784,6 @@ def make_oci(context: Context, root_layer: Path, dst: Path) -> None:
27842784
else datetime.datetime.now(tz=datetime.timezone.utc)
27852785
).isoformat()
27862786

2787-
# We could also use the default (which have a space after the punctuation symbol)
2788-
# but these make it easier to verify the output against other tools (e.g. skopeo)
2789-
# which often strip the redundant spaces.
2790-
json_args = {"separators": (",", ":")}
2791-
27922787
oci_config = {
27932788
"created": creation_time,
27942789
"architecture": context.config.architecture.to_oci(),
@@ -2814,7 +2809,7 @@ def make_oci(context: Context, root_layer: Path, dst: Path) -> None:
28142809
},
28152810
],
28162811
}
2817-
oci_config_blob = json.dumps(oci_config, **json_args)
2812+
oci_config_blob = json.dumps(oci_config)
28182813
oci_config_digest = hashlib.sha256(oci_config_blob.encode()).hexdigest()
28192814
(ca_store / oci_config_digest).write_text(oci_config_blob)
28202815

@@ -2841,7 +2836,7 @@ def make_oci(context: Context, root_layer: Path, dst: Path) -> None:
28412836
} if context.config.image_version else {}),
28422837
}
28432838
}
2844-
oci_manifest_blob = json.dumps(oci_manifest, **json_args)
2839+
oci_manifest_blob = json.dumps(oci_manifest)
28452840
oci_manifest_digest = hashlib.sha256(oci_manifest_blob.encode()).hexdigest()
28462841
(ca_store / oci_manifest_digest).write_text(oci_manifest_blob)
28472842

@@ -2859,11 +2854,10 @@ def make_oci(context: Context, root_layer: Path, dst: Path) -> None:
28592854
],
28602855
},
28612856
f,
2862-
**json_args
28632857
)
28642858

28652859
with (dst / "oci-layout").open("w") as f:
2866-
json.dump({"imageLayoutVersion": "1.0.0"}, f, **json_args)
2860+
json.dump({"imageLayoutVersion": "1.0.0"}, f)
28672861

28682862

28692863
def make_esp(context: Context, uki: Path) -> list[Partition]:
@@ -3154,10 +3148,7 @@ def build_image(context: Context) -> None:
31543148
make_tar(
31553149
context.root, context.staging / "rootfs.layer",
31563150
tools=context.config.tools(),
3157-
# Make sure tar uses user/group information from the root directory instead of the host.
3158-
sandbox=context.sandbox(
3159-
options=["--ro-bind", context.root, context.root, *finalize_passwd_mounts(context.root)],
3160-
),
3151+
sandbox=context.sandbox,
31613152
# We do not want SELinux xattrs in OCI layers
31623153
# as they seldom make sense inside containers.
31633154
options=["--xattrs-exclude", "security.selinux"],

mkosi/archive.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# SPDX-License-Identifier: LGPL-2.1+
22

33
import os
4-
from collections.abc import Iterable
4+
from collections.abc import Iterable, Sequence
55
from pathlib import Path
6-
from typing import Optional, Sequence
6+
from typing import Optional
77

8-
from mkosi.config import __version__
98
from mkosi.log import log_step
109
from mkosi.run import find_binary, run
1110
from mkosi.sandbox import SandboxProtocol, finalize_passwd_mounts, nosandbox

0 commit comments

Comments
 (0)