Skip to content

Commit

Permalink
[Storage]
Browse files Browse the repository at this point in the history
* improve print
  • Loading branch information
jbleyel committed Jan 8, 2025
1 parent 1119f80 commit 4b900aa
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/python/Components/Storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ def prepare(self):
try:
open(self.nomoutFile, "wb").close()
except Exception as e:
print("[UnmountTask] ERROR: Failed to create /dev/nomount file:", e)
print(f"[{self.__class__.__name__}] ERROR: Failed to create /dev/nomount file:{e}")
self.setTool('umount')
self.args.append('-f')
self.args.append('-l')
Expand All @@ -384,7 +384,7 @@ def prepare(self):
self.args.append(parts[0])
self.mountpoints.append(parts[0])
if not self.mountpoints:
print("[UnmountTask] No mountpoints found?")
print(f"[{self.__class__.__name__}] No mountpoints found?")
self.cmd = 'true'
self.args = [self.cmd]
else:
Expand All @@ -411,7 +411,8 @@ def prepare(self):
parts = line.split()
self.args.append(parts[0])
if not swaps:
print("[UnmountSwapTask] No mountpoints found?")
if self.debug:
print(f"[{self.__class__.__name__}] No mountpoints found!")
self.cmd = 'true'
self.args = [self.cmd]

Expand All @@ -433,7 +434,7 @@ def prepare(self):
try:
unlink(self.nomoutFile)
except Exception as e:
print("[MountTask] ERROR: Failed to remove /dev/nomount file:", e)
print(f"[{self.__class__.__name__}] ERROR: Failed to remove /dev/nomount file: {e}")

if self.mountDevice:
part = "p1" if "mmcblk" in self.storageDevice.disk else "1"
Expand Down Expand Up @@ -471,7 +472,7 @@ def processOutput(self, data):
d[1] = d[1].split("\x08", 1)[0]
self.setProgress(80 * int(d[0]) // int(d[1]))
except Exception as err:
print(f"[MkfsTask] MkfsTask - [Mkfs] Error: {err}!")
print(f"[{self.__class__.__name__}] Error: {err}!")
return # Don't log the progress.
self.log.append(data)

Expand Down

0 comments on commit 4b900aa

Please sign in to comment.