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

Bastian Germann bage at linutronix.de
Mon Jul 11 19:11:45 CEST 2022


Am 10.07.22 um 10:35 schrieb Holger Dengler:
> 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>

Reviewed-by: Bastian Germann <bage at linutronix.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"),


More information about the elbe-devel mailing list