Merge "Fix invalid argument formatting in exception messages"

This commit is contained in:
Zuul
2021-02-04 19:14:46 +00:00
committed by Gerrit Code Review
+3 -3
View File
@@ -61,7 +61,7 @@ class GuestFS(object):
def add_drive_opts(self, file, *args, **kwargs):
if file == "/some/fail/file":
raise RuntimeError("%s: No such file or directory", file)
raise RuntimeError("%s: No such file or directory" % file)
self.drives.append((file, kwargs))
@@ -169,7 +169,7 @@ class GuestFS(object):
if ((cfgpath.startswith("/files/etc/passwd") or
cfgpath.startswith("/files/etc/group")) and not
self.CAN_SET_OWNERSHIP):
raise RuntimeError("Node not found %s", cfgpath)
raise RuntimeError("Node not found %s" % cfgpath)
if cfgpath == "/files/etc/passwd/root/uid":
return 0
@@ -183,7 +183,7 @@ class GuestFS(object):
return 500
elif cfgpath == "/files/etc/group/admins/gid":
return 600
raise RuntimeError("Unknown path %s", cfgpath)
raise RuntimeError("Unknown path %s" % cfgpath)
def set_trace(self, enabled):
self.trace_enabled = enabled