Merge lp:~cmars/juju-core/1.18-resolve-cs-series into lp:juju-core/1.18

Proposed by Casey Marshall
Status: Merged
Merged at revision: 2265
Proposed branch: lp:~cmars/juju-core/1.18-resolve-cs-series
Merge into: lp:juju-core/1.18
Diff against target: 73 lines (+20/-5)
3 files modified
cmd/juju/common.go (+8/-0)
cmd/juju/deploy.go (+8/-5)
provider/local/environprovider.go (+4/-0)
To merge this branch: bzr merge lp:~cmars/juju-core/1.18-resolve-cs-series
Reviewer Review Type Date Requested Status
Juju Engineering Pending
Review via email: mp+214097@code.launchpad.net

Commit message

Ported r2559 from trunk to 1.18

For the deploy and upgradecharm commands, when a series is not provided, and a
default-series is not set in the environment config, the client will resolve
the series with the charm store, through the state server. If the client is
working with a 1.16 state server, it will resolve the series directly with the
charm store.

Existing environments will have a default-series, so they should have no
change in series selection.

New environments will continue to support the default-series config setting,
but it can be omitted, and is not set by default.

Description of the change

Ported r2559 from trunk to 1.18

For the deploy and upgradecharm commands, when a series is not provided, and a
default-series is not set in the environment config, the client will resolve
the series with the charm store, through the state server. If the client is
working with a 1.16 state server, it will resolve the series directly with the
charm store.

Existing environments will have a default-series, so they should have no
change in series selection.

New environments will continue to support the default-series config setting,
but it can be omitted, and is not set by default.

https://codereview.appspot.com/84190043/

To post a comment you must log in.
Revision history for this message
Casey Marshall (cmars) wrote :

Reviewers: mp+214097_code.launchpad.net,

Message:
Please take a look.

Description:
Ported r2559 from trunk to 1.18

For the deploy and upgradecharm commands, when a series is not provided,
and a
default-series is not set in the environment config, the client will
resolve
the series with the charm store, through the state server. If the client
is
working with a 1.16 state server, it will resolve the series directly
with the
charm store.

Existing environments will have a default-series, so they should have no
change in series selection.

New environments will continue to support the default-series config
setting,
but it can be omitted, and is not set by default.

https://code.launchpad.net/~cmars/juju-core/1.18-resolve-cs-series/+merge/214097

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/84190043/

Affected files (+448, -150 lines):
   A [revision details]
   M charm/charm.go
   M charm/charm_test.go
   M charm/url.go
   M charm/url_test.go
   M cmd/juju/addmachine.go
   M cmd/juju/bootstrap_test.go
   M cmd/juju/common.go
   M cmd/juju/deploy.go
   M cmd/juju/environment_test.go
   M cmd/juju/publish.go
   M cmd/juju/upgradecharm.go
   M cmd/juju/upgradejuju_test.go
   M cmd/plugins/juju-metadata/imagemetadata.go
   M cmd/plugins/juju-metadata/imagemetadata_test.go
   M environs/bootstrap/bootstrap_test.go
   M environs/bootstrap/synctools.go
   M environs/config/config.go
   M environs/config/config_test.go
   M environs/jujutest/livetests.go
   M environs/testing/tools.go
   M juju/apiconn_test.go
   M juju/testing/conn.go
   M juju/testing/instance.go
   M provider/azure/environ_test.go
   M provider/common/bootstrap.go
   M provider/dummy/environs.go
   M provider/ec2/ec2.go
   M provider/ec2/live_test.go
   M provider/ec2/local_test.go
   M provider/joyent/environ.go
   M provider/openstack/provider.go
   M state/api/client.go
   M state/api/params/params.go
   M state/apiserver/client/client.go
   M state/apiserver/client/client_test.go
   M testing/environ.go
   M worker/provisioner/container_initialisation_test.go
   M worker/provisioner/kvm-broker_test.go
   M worker/provisioner/lxc-broker_test.go
   M worker/provisioner/provisioner_test.go

Revision history for this message
Casey Marshall (cmars) wrote :

This is a cherry-pick of r2559 from trunk.

Original trunk proposal, for context:
https://codereview.appspot.com/80280043/

PTAL & thanks,
-Casey

https://codereview.appspot.com/84190043/

Revision history for this message
Ian Booth (wallyworld) wrote :

Cherry pick looks ok.
Only reviewed for obvious backporting errors as original work was
approved.

https://codereview.appspot.com/84190043/

Revision history for this message
Casey Marshall (cmars) wrote :
Revision history for this message
Casey Marshall (cmars) wrote :

On 2014/04/09 22:49:16, cmars wrote:
> Please take a look.

lbox picked up the wrong branch here, please ignore.

https://codereview.appspot.com/84190043/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'cmd/juju/common.go'
--- cmd/juju/common.go 2014-04-03 19:11:11 +0000
+++ cmd/juju/common.go 2014-04-09 22:48:20 +0000
@@ -4,6 +4,8 @@
4package main4package main
55
6import (6import (
7 "fmt"
8
7 "launchpad.net/juju-core/charm"9 "launchpad.net/juju-core/charm"
8 "launchpad.net/juju-core/cmd"10 "launchpad.net/juju-core/cmd"
9 "launchpad.net/juju-core/environs"11 "launchpad.net/juju-core/environs"
@@ -65,6 +67,12 @@
65 }67 }
66 // Otherwise, look up the best supported series for this charm68 // Otherwise, look up the best supported series for this charm
67 if series == "" {69 if series == "" {
70 if ref.Schema == "local" {
71 possibleUrl := &charm.URL{Reference: ref, Series: "precise"}
72 logger.Errorf(`The series is not specified in the environment (default-series) or with the charm. Did you mean:
73 %s`, possibleUrl.String())
74 return nil, fmt.Errorf("cannot resolve series for charm: %q", ref)
75 }
68 return client.ResolveCharm(ref)76 return client.ResolveCharm(ref)
69 }77 }
70 return &charm.URL{Reference: ref, Series: series}, nil78 return &charm.URL{Reference: ref, Series: series}, nil
7179
=== modified file 'cmd/juju/deploy.go'
--- cmd/juju/deploy.go 2014-04-03 19:11:11 +0000
+++ cmd/juju/deploy.go 2014-04-09 22:48:20 +0000
@@ -34,8 +34,7 @@
3434
35const deployDoc = `35const deployDoc = `
36<charm name> can be a charm URL, or an unambiguously condensed form of it;36<charm name> can be a charm URL, or an unambiguously condensed form of it;
37assuming a current default series of "precise", the following forms will be37assuming a current series of "precise", the following forms will be accepted:
38accepted.
3938
40For cs:precise/mysql39For cs:precise/mysql
41 mysql40 mysql
@@ -44,12 +43,16 @@
44For cs:~user/precise/mysql43For cs:~user/precise/mysql
45 cs:~user/mysql44 cs:~user/mysql
4645
47For local:precise/mysql46The current series is determined first by the default-series environment
48 local:mysql47setting, followed by the preferred series for the charm in the charm store.
4948
50In all cases, a versioned charm URL will be expanded as expected (for example,49In these cases, a versioned charm URL will be expanded as expected (for example,
51mysql-33 becomes cs:precise/mysql-33).50mysql-33 becomes cs:precise/mysql-33).
5251
52However, for local charms, when the default-series is not specified in the
53environment, one must specify the series. For example:
54 local:precise/mysql
55
53<service name>, if omitted, will be derived from <charm name>.56<service name>, if omitted, will be derived from <charm name>.
5457
55Constraints can be specified when using deploy by specifying the --constraints58Constraints can be specified when using deploy by specifying the --constraints
5659
=== modified file 'provider/local/environprovider.go'
--- provider/local/environprovider.go 2014-04-01 21:11:50 +0000
+++ provider/local/environprovider.go 2014-04-09 22:48:20 +0000
@@ -256,6 +256,10 @@
256 #256 #
257 # network-bridge: lxcbr0257 # network-bridge: lxcbr0
258258
259 # The default series to deploy the state-server and charms on.
260 #
261 # default-series: precise
262
259`[1:]263`[1:]
260}264}
261265

Subscribers

People subscribed via source and target branches

to all changes: