Description: Fix exception.NovaException
Author: Thomas Goirand <zigo@debian.org>
Forwarded: no
Last-Update: 2024-11-19

Index: nova/nova/virt/disk/api.py
===================================================================
--- nova.orig/nova/virt/disk/api.py
+++ nova/nova/virt/disk/api.py
@@ -649,7 +649,7 @@ def _set_passwd(username, admin_passwd,
             break
     else:
         msg = _('User %(username)s not found in password file.')
-        raise exception.NovaException(msg % username)
+        raise exception.NovaException(msg % {'username': username})
 
     # update password in the shadow file. It's an error if the
     # user doesn't exist.
@@ -665,6 +665,6 @@ def _set_passwd(username, admin_passwd,
 
     if not found:
         msg = _('User %(username)s not found in shadow file.')
-        raise exception.NovaException(msg % username)
+        raise exception.NovaException(msg % {'username': username})
 
     return "\n".join(new_shadow)
