juju status does not fail obviously when bad input it used

Bug #1696245 reported by Richard Harding
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Medium
Anastasia
2.3
Fix Released
Medium
Anastasia

Bug Description

I've bootstrapped a controller with 2.2-rc1. There are only the default models of controller and default. I've deployed several applications into the controller model. I can run juju status on that model and get a normal looking status.

If I run:

    juju status 123

I actually get the status output of the controller model which is the current one selected.

If I run:

    juju status 1234

I get status for the controller, but everything is empty. It looks like the status of a completely empty model. No machines or applications deployed.

If I run:

   juju status -m 1234

I get an expected

    ERROR model test:admin/1234 not found

I think that the status by application/unit should also error if the application or unit name are not matched vs random status output that appears to come out currently.

Tags: status filters
Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 1696245] [NEW] juju status does not fail obviously when bad input it used

I think we're running into a little bit of 'DWIM' issues. For example if
you do "juju status error" and nothing is in error, would you expect it to
give you a nonzero exit?
Is it only machine numbers that should exit nonzero?
What about application names that are typo'd?
What about unit numbers? app/10
I'm curious how
  'juju status 123' doesn't return an empty list but 'juju status 1234' is
empty. Do you have a machine 123?

It feels like we need to be less DWIM before we can really know for sure
what the user intended, and cause an error if we can't satisfy that request.

John
=:->

On Wed, Jun 7, 2017 at 12:42 AM, Richard Harding <<email address hidden>
> wrote:

> Public bug reported:
>
> I've bootstrapped a controller with 2.2-rc1. There are only the default
> models of controller and default. I've deployed several applications
> into the controller model. I can run juju status on that model and get a
> normal looking status.
>
> If I run:
>
> juju status 123
>
> I actually get the status output of the controller model which is the
> current one selected.
>
> If I run:
>
> juju status 1234
>
> I get status for the controller, but everything is empty. It looks like
> the status of a completely empty model. No machines or applications
> deployed.
>
> If I run:
>
> juju status -m 1234
>
> I get an expected
>
> ERROR model test:admin/1234 not found
>
> I think that the status by application/unit should also error if the
> application or unit name are not matched vs random status output that
> appears to come out currently.
>
> ** Affects: juju
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are subscribed to juju.
> Matching subscriptions: juju bugs
> https://bugs.launchpad.net/bugs/1696245
>
> Title:
> juju status does not fail obviously when bad input it used
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1696245/+subscriptions
>

Changed in juju:
status: New → Triaged
importance: Undecided → Medium
tags: added: filters status
Revision history for this message
Jeff Pihach (hatch) wrote :

A common mistake that I make is running `juju status mymodel` and leaving off the -m. This always returns an empty status for whatever model it's sitting on, usually an empty controller. I'd expect this to return the status for the model or at the least return an error saying that nothing is found instead of returning an empty status report.

Revision history for this message
Anastasia (anastasia-macmood) wrote :

PR [1] (against 2.3) ensures that stderr contains the reasons for anempty status - either the model is empty or the filter(s) did not match anything.

The output displayed in stdout changed as well: we no longer display empty sections. In other words, we will not have headers visible if there is no data for the section.

[1] https://github.com/juju/juju/pull/8727

Changed in juju:
status: Triaged → In Progress
assignee: nobody → Anastasia (anastasia-macmood)
milestone: none → 2.4-beta3
Revision history for this message
Anastasia (anastasia-macmood) wrote :

PR against develop (2.4): https://github.com/juju/juju/pull/8729

Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
status: Fix Committed → Fix Released
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.