[elbe-devel] [PATCH v1 2/2] commands: show: fix passwd handling

Holger Dengler holger at hdengler.de
Sun Jul 10 10:35:17 CEST 2022


The <passwd> node in XML has been replaced by <passwd_hashed> in the
schema. It is no longer mandatory, but it can still appear in XMLs. For
XMLs without this node, skip the password output.

Signed-off-by: Holger Dengler <holger at hdengler.de>
---
 elbepack/commands/show.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/elbepack/commands/show.py b/elbepack/commands/show.py
index bd00c11e6..354d083a0 100644
--- a/elbepack/commands/show.py
+++ b/elbepack/commands/show.py
@@ -62,7 +62,8 @@ def run_command(argv):
     for s in xml.text("./project/description").splitlines():
         print("%s" % s.strip())
     if opt.verbose:
-        print("root password: %s" % xml.text("./target/passwd"))
+        if xml.has("./target/passwd"):
+            print("root password: %s" % xml.text("./target/passwd"))
         print("primary_mirror: %s://%s%s" % (
               xml.text("./project/mirror/primary_proto"),
               xml.text("./project/mirror/primary_host"),
-- 
2.36.1



More information about the elbe-devel mailing list