From 378a2127862b63d0c43e86e495c351c79c2ff220 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 13 Sep 2024 23:55:02 +0200 Subject: [PATCH] mypy/deb,fs,grub --- rwx/deb/__init__.py | 6 ++---- rwx/fs/__init__.py | 6 +++--- rwx/grub/__init__.py | 4 +--- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/rwx/deb/__init__.py b/rwx/deb/__init__.py index d205222..fcd4198 100644 --- a/rwx/deb/__init__.py +++ b/rwx/deb/__init__.py @@ -1,8 +1,6 @@ """Wrap Debian commands.""" -import cmd - -from rwx import ps +from rwx import cmd, ps cmd.need("debootstrap") @@ -20,4 +18,4 @@ def bootstrap(root_path: str, suite: str, mirror_location: str) -> None: (root_path,), (mirror_location,), ] - return ps.run(command) + ps.run(*command) diff --git a/rwx/fs/__init__.py b/rwx/fs/__init__.py index 3902b5a..0685c44 100644 --- a/rwx/fs/__init__.py +++ b/rwx/fs/__init__.py @@ -14,7 +14,7 @@ def create_image(file_path: str, size_bytes: int) -> None: ps.run( ("qemu-img", "create"), ("-f", "qcow2"), - (file_path, size_bytes), + (file_path, str(size_bytes)), ) @@ -36,9 +36,9 @@ def get_mount_uuid(path: str) -> str: def get_path_mount(path: str) -> str: """Return the mountpoint path of an arbitrary path.""" return ps.run_line( - ("stat",), + "stat", ("--format", "%m"), - (path,), + path, ) diff --git a/rwx/grub/__init__.py b/rwx/grub/__init__.py index f4ceaea..accec9f 100644 --- a/rwx/grub/__init__.py +++ b/rwx/grub/__init__.py @@ -1,8 +1,6 @@ """Wrap GRUB commands.""" -import cmd - -from rwx import ps +from rwx import cmd, ps cmd.need("grub-mkimage")