cmd/modelcmd: inject jujuclient.ClientStore #4419

Merged
merged 2 commits into from Feb 15, 2016

Conversation

Projects
None yet
2 participants
Member

axw commented Feb 15, 2016

And some related changes to prepare for using jujuclient everywhere:

  • change APIOpener to take a controller name
    and a model name. Model names are relative
    to controller names, and a client can know
    about two models with the same name for
    different controllers
  • add JujuCommandBase.RefreshModels method,
    which will refresh the client's knowledge
    of models in the specified controller for
    the current user
  • ModelCommandBase.NewAPIRoot is updated to
    refresh the client's model cache if an
    unknown model is specified. This means you
    can do "juju status -m " for a model
    that you haven't previously switched to.
  • change GetDefaultModel to take a ClientStore,
    and use it to get the current model for the
    current controller. We still honour the
    current-model file, until all of the tests
    stop relying on it
  • ModelCommandBase.SetModelName now accepts
    model names in either format "model", or
    "controller:model". In the first format,
    the current controller is assumed. This
    method now records the controller name for
    use when opening API connections.

(Review request: http://reviews.vapour.ws/r/3859/)

axw added some commits Feb 14, 2016

cmd/modelcmd: inject jujuclient.ClientStore
And some related changes to prepare for using
jujuclient everywhere:

 - change APIOpener to take a controller name
   and a model name. Model names are relative
   to controller names, and a client can know
   about two models with the same name for
   different controllers
 - add JujuCommandBase.RefreshModels method,
   which will refresh the client's knowledge
   of models in the specified controller for
   the current user
 - ModelCommandBase.NewAPIRoot is updated to
   refresh the client's model cache if an
   unknown model is specified. This means you
   can do "juju status -m <model>" for a model
   that you haven't previously switched to.
 - change GetDefaultModel to take a ClientStore,
   and use it to get the current model for the
   current controller. We still honour the
   current-model file, until all of the tests
   stop relying on it
 - ModelCommandBase.SetModelName now accepts
   model names in either format "model", or
   "controller:model". In the first format,
   the current controller is assumed. This
   method now records the controller name for
   use when opening API connections.
Member

axw commented Feb 15, 2016

$$merge$$

Contributor

jujubot commented Feb 15, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Feb 15, 2016

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/6401

Member

axw commented Feb 15, 2016

$$merge$$

Contributor

jujubot commented Feb 15, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

Contributor

jujubot commented Feb 15, 2016

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/6403

Member

axw commented Feb 15, 2016

$$FUUUUUUUUUUUUUUU$$

Contributor

jujubot commented Feb 15, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

jujubot added a commit that referenced this pull request Feb 15, 2016

Merge pull request #4419 from axw/cloud-credentials-modelcmd
cmd/modelcmd: inject jujuclient.ClientStore

And some related changes to prepare for using jujuclient everywhere:

- change APIOpener to take a controller name
  and a model name. Model names are relative
  to controller names, and a client can know
  about two models with the same name for
  different controllers
- add JujuCommandBase.RefreshModels method,
  which will refresh the client's knowledge
  of models in the specified controller for
  the current user
- ModelCommandBase.NewAPIRoot is updated to
  refresh the client's model cache if an
  unknown model is specified. This means you
  can do "juju status -m <model>" for a model
  that you haven't previously switched to.
- change GetDefaultModel to take a ClientStore,
  and use it to get the current model for the
  current controller. We still honour the
  current-model file, until all of the tests
  stop relying on it
- ModelCommandBase.SetModelName now accepts
  model names in either format "model", or
  "controller:model". In the first format,
  the current controller is assumed. This
  method now records the controller name for
  use when opening API connections.

(Review request: http://reviews.vapour.ws/r/3859/)

@jujubot jujubot merged commit 04ea27f into juju:cloud-credentials Feb 15, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment