Skip to content

Commit

Permalink
Merge pull request juju#12 from 4a6f656c/caas-prototype-refresh
Browse files Browse the repository at this point in the history
api,cmd/modelcmd: bring model type through to store.
  • Loading branch information
Menno Smits committed Apr 10, 2017
2 parents 04efb01 + e4fbbfc commit d80ca5c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/base/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
type UserModel struct {
Name string
UUID string
Type string
Owner string
LastConnection *time.Time
}
Expand Down
1 change: 1 addition & 0 deletions api/modelmanager/modelmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ func (c *Client) ListModels(user string) ([]base.UserModel, error) {
result[i] = base.UserModel{
Name: model.Name,
UUID: model.UUID,
Type: model.Type,
Owner: owner.Id(),
LastConnection: model.LastConnection,
}
Expand Down
5 changes: 4 additions & 1 deletion cmd/modelcmd/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,10 @@ func (c *JujuCommandBase) RefreshModels(store jujuclient.ClientStore, controller
return errors.Trace(err)
}
for _, model := range models {
modelDetails := jujuclient.ModelDetails{ModelUUID: model.UUID}
modelDetails := jujuclient.ModelDetails{
ModelUUID: model.UUID,
Type: jujuclient.ModelType(model.Type),
}
owner := names.NewUserTag(model.Owner)
modelName := jujuclient.JoinOwnerModelName(owner, model.Name)
if err := store.UpdateModel(controllerName, modelName, modelDetails); err != nil {
Expand Down

0 comments on commit d80ca5c

Please sign in to comment.