Skip to content

Commit a166c23

Browse files
committed
Resolve linter complaints
1 parent acbdd5d commit a166c23

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
@@ -2818,11 +2818,6 @@ def make_oci(context: Context, root_layer: Path, dst: Path) -> None:
28182818
else datetime.datetime.now(tz=datetime.timezone.utc)
28192819
).isoformat()
28202820

2821-
# We could also use the default (which have a space after the punctuation symbol)
2822-
# but these make it easier to verify the output against other tools (e.g. skopeo)
2823-
# which often strip the redundant spaces.
2824-
json_args = {"separators": (",", ":")}
2825-
28262821
oci_config = {
28272822
"created": creation_time,
28282823
"architecture": context.config.architecture.to_oci(),
@@ -2848,7 +2843,7 @@ def make_oci(context: Context, root_layer: Path, dst: Path) -> None:
28482843
},
28492844
],
28502845
}
2851-
oci_config_blob = json.dumps(oci_config, **json_args)
2846+
oci_config_blob = json.dumps(oci_config)
28522847
oci_config_digest = hashlib.sha256(oci_config_blob.encode()).hexdigest()
28532848
(ca_store / oci_config_digest).write_text(oci_config_blob)
28542849

@@ -2875,7 +2870,7 @@ def make_oci(context: Context, root_layer: Path, dst: Path) -> None:
28752870
} if context.config.image_version else {}),
28762871
}
28772872
}
2878-
oci_manifest_blob = json.dumps(oci_manifest, **json_args)
2873+
oci_manifest_blob = json.dumps(oci_manifest)
28792874
oci_manifest_digest = hashlib.sha256(oci_manifest_blob.encode()).hexdigest()
28802875
(ca_store / oci_manifest_digest).write_text(oci_manifest_blob)
28812876

@@ -2893,11 +2888,10 @@ def make_oci(context: Context, root_layer: Path, dst: Path) -> None:
28932888
],
28942889
},
28952890
f,
2896-
**json_args
28972891
)
28982892

28992893
with (dst / "oci-layout").open("w") as f:
2900-
json.dump({"imageLayoutVersion": "1.0.0"}, f, **json_args)
2894+
json.dump({"imageLayoutVersion": "1.0.0"}, f)
29012895

29022896

29032897
def make_esp(context: Context, uki: Path) -> list[Partition]:
@@ -3188,10 +3182,7 @@ def build_image(context: Context) -> None:
31883182
make_tar(
31893183
context.root, context.staging / "rootfs.layer",
31903184
tools=context.config.tools(),
3191-
# Make sure tar uses user/group information from the root directory instead of the host.
3192-
sandbox=context.sandbox(
3193-
options=["--ro-bind", context.root, context.root, *finalize_passwd_mounts(context.root)],
3194-
),
3185+
sandbox=context.sandbox,
31953186
# We do not want SELinux xattrs in OCI layers
31963187
# as they seldom make sense inside containers.
31973188
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)