list-models should point out list-controllers command in error message

Bug #1618998 reported by Jeff Pihach
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
Medium
Nate Finch

Bug Description

It would be really nice if the error message formats were the same and included a little bit more information when no model is available.

I have multiple controllers and multiple models. I deleted one of the controllers and its models and when I ran `juju status` I was given a nice error message:

$ juju status
  ERROR no model in focus

  Please use "juju models" to see models available to you.
  You can set current model by running "juju switch"
  or specify any other model on the command line using the "-m" flag.

But when I ran `juju models`:

$ juju models
  error: no controller

  Please either create your own new controller using "juju bootstrap" or
  connect to another controller that you have been given access to using "juju register".

Note how the structure is a little different but also, I have other controllers registered and I simply have to switch to them. It would be nice if this message also included information about `juju controllers` as the previous one had information about `juju models`

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

This behavior is intentional. See https://bugs.launchpad.net/juju/+bug/1589061

Changed in juju:
status: New → Invalid
Revision history for this message
Jeff Pihach (hatch) wrote :

If I'm reading that bug correctly this is the same situation as listed in case #2.

I am not currently logged into a controller but there is an available controller that has already been registered. simply running `juju register` just gives me an error which isn't ideal either. To be able to find the other controllers I can connect to I need to run `juju controllers`.

$ juju register
  error: registration data missing

Changed in juju:
status: Invalid → New
tags: added: usability
Changed in juju:
status: New → Triaged
importance: Undecided → Medium
milestone: none → 2.0.0
Changed in juju:
milestone: 2.0.0 → 2.0-rc1
assignee: nobody → Richard Harding (rharding)
Changed in juju:
milestone: 2.0-rc1 → 2.0-rc2
Nate Finch (natefinch)
Changed in juju:
assignee: Richard Harding (rharding) → Nate Finch (natefinch)
Revision history for this message
Nate Finch (natefinch) wrote :

OK, so this seems to be a bug where we return the wrong error - the error we're returning is "there aren't any controllers" but there are, so we need to return the "there are controllers, you just need to switch to one" error.

Revision history for this message
Nate Finch (natefinch) wrote :

Also we're returning an error from command.Init() which doesn't get the same error styling as an error from Run. This is a separate problem, but I can address it for this specific bug fairly easily.

Nate Finch (natefinch)
Changed in juju:
status: Triaged → In Progress
Nate Finch (natefinch)
Changed in juju:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
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.