juju config prints empty json to stdout for invalid app names

Bug #1983737 reported by Mert Kirpici
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Medium
Unassigned

Bug Description

If `juju config` is called with an invalid app or config option name, it will print the an error message into stderr, alongside a valid empty json object into stdout.

miles@mertkirpici-bastion-focal:~$ juju config foo
{}
ERROR application "foo" not found (not found)

miles@mertkirpici-bastion-focal:~$ juju config keystone foo
{}
ERROR key "foo" not found in "keystone" application config or charm settings.

miles@mertkirpici-bastion-focal:~$ juju config keystone foo 2>/dev/null
{}

I am not sure if this is by design, however `list-actions` only prints error into stderr.

miles@mertkirpici-bastion-focal:~$ juju list-actions foo
ERROR application "foo" not found

Tags: cli config
Changed in juju:
status: New → Triaged
importance: Undecided → High
importance: High → Medium
assignee: nobody → Evanson Mwangi (mr-parish)
milestone: none → 2.9.34
tags: added: cli config
Changed in juju:
status: Triaged → In Progress
Changed in juju:
milestone: 2.9.34 → 2.9.35
Changed in juju:
milestone: 2.9.35 → 2.9.36
Changed in juju:
milestone: 2.9.36 → 2.9.37
Changed in juju:
milestone: 2.9.37 → 2.9.38
Changed in juju:
status: In Progress → Triaged
assignee: Evanson Mwangi (mr-parish) → nobody
milestone: 2.9.38 → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.