diff --git a/lib/sysgeneral.py b/lib/sysgeneral.py index 3af9f4d..ba050ac 100644 --- a/lib/sysgeneral.py +++ b/lib/sysgeneral.py @@ -33,7 +33,7 @@ class SysGeneral: def __del__(self): if not self.preserve_tmp: - print("Unmounting tmpfs from %s" % (self.tmp_dir)) + print(f"Unmounting tmpfs from {self.tmp_dir}") umount(self.tmp_dir) os.rmdir(self.tmp_dir) @@ -41,7 +41,7 @@ class SysGeneral: """Mount the tmpfs for this sysx""" if not os.path.isdir(self.tmp_dir): os.mkdir(self.tmp_dir) - print("Mounting tmpfs on %s" % (self.tmp_dir)) + print(f"Mounting tmpfs on {self.tmp_dir}") mount('tmpfs', self.tmp_dir, 'tmpfs', 'size=8G') def check_file(self, file_name): @@ -80,7 +80,7 @@ class SysGeneral: # Actually download the file if not os.path.isfile(abs_file_name): - print("Downloading: %s" % (file_name)) + print(f"Downloading: {file_name}") request = requests.get(url, allow_redirects=True) # pylint: disable=consider-using-with open(abs_file_name, 'wb').write(request.content) diff --git a/rootfs.py b/rootfs.py index c2619a4..4949e0c 100755 --- a/rootfs.py +++ b/rootfs.py @@ -81,7 +81,7 @@ def main(): def bootstrap(args, system_a, system_b, system_c): """Kick off bootstrap process.""" - print("Bootstrapping %s -- SysA" % (args.arch)) + print(f"Bootstrapping {args.arch} -- SysA") if args.chroot: find_chroot = """ import shutil @@ -97,7 +97,7 @@ print(shutil.which('chroot')) # We skip sysb as that is only pertinent to "hardware" (not chroot) system_c.chroot_transition(system_a.tmp_dir) # sysc - print("Bootstrapping %s -- SysC" % (args.arch)) + print(f"Bootstrapping {args.arch} -- SysC") init = os.path.join(os.sep, 'init') run('sudo', chroot_binary, system_c.tmp_dir, init) diff --git a/sysc.py b/sysc.py index 1f9a598..2a8c547 100755 --- a/sysc.py +++ b/sysc.py @@ -35,9 +35,9 @@ class SysC(SysGeneral): def __del__(self): if not self.preserve_tmp: if not self.chroot: - print("Deleting %s" % (self.dev_name)) + print(f"Deleting {self.dev_name}") run('sudo', 'losetup', '-d', self.dev_name) - print("Unmounting tmpfs from %s" % (self.tmp_dir)) + print(f"Unmounting tmpfs from {self.tmp_dir}") umount(self.tmp_dir) os.rmdir(self.tmp_dir)