juju models doesn't honor $JUJU_MODEL

Bug #1664611 reported by Felipe Reyes
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Expired
Medium
Unassigned
2.0
Won't Fix
Undecided
Unassigned

Bug Description

Steps to reproduce:

1) create 2 models
   juju add-model m1
   juju add-model m2
2) switch to model m1
   juju switch m1
3) set env variable JUJU_MODEL to use m2
   export JUJU_MODEL=m2
4) List models
   juju models

Expected result:

Controller: freyes

Model Cloud/Region Status Machines Cores Access Last connection
controller xxx/xxx available 1 2 admin just now
m2* xxx/xxx available 18 41 admin 2017-02-13
m1 xxx/xxx available 12 17 admin 1 minute ago

Actual result:

Controller: freyes

Model Cloud/Region Status Machines Cores Access Last connection
controller xxx/xxx available 1 2 admin just now
m2 xxx/xxx available 18 41 admin 2017-02-13
m1* xxx/xxx available 12 17 admin 1 minute ago

juju models should print in green 'm2' and append '*'

Revision history for this message
Felipe Reyes (freyes) wrote :

I just noticed that 'juju switch' (without arguments) shows this same problem, from the help description: "Selects or **identifies** the current controller and model" (emphasis mine), so it would be expected that it prints the controller:model that juju commands will use in the absence of "-m MODEL"

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

@Felipe,

Could you please clarify what Juju version you are using?

Changed in juju:
status: New → Incomplete
Revision history for this message
Felipe Reyes (freyes) wrote : Re: [Bug 1664611] Re: juju models doesn't honor $JUJU_MODEL

On Tue, Feb 14, 2017 at 11:50:41PM -0000, Anastasia wrote:
> @Felipe,
>
> Could you please clarify what Juju version you are using?

$ juju --version
2.0.3-xenial-amd64

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

Thanks, Felipe!

I'll mark it as Won't Fix for 2.0 as we are not planning any further 2.0.x releases.

Changed in juju:
status: Incomplete → Triaged
importance: Undecided → Medium
Revision history for this message
Andrew Wilkins (axwalk) wrote :

The fix for this is a little bit complicated, since there's interaction between $JUJU_MODEL, the current-controller value in the controllers.yaml file, and the -c flag.

$JUJU_MODEL may or may not specify a controller, i.e. it can have the syntax "controller:model", or just "model". In the latter case, the current controller is implied.

I think what we should do is prohibit use of "-c" if $JUJU_MODEL is specified, and set the controller name to the controller specified or implied by $JUJU_MODEL.

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

Removing 2.1 milestone as we will not be addressing this issue in 2.1.

no longer affects: juju/2.1
Revision history for this message
Canonical Juju QA Bot (juju-qa-bot) wrote :

This bug has not been updated in 5 years, so we're marking it Expired. If you believe this is incorrect, please update the status.

Changed in juju:
status: Triaged → Expired
tags: added: expirebugs-bot
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.