import (
+ "fmt"
+
"launchpad.net/juju-core/charm"
"launchpad.net/juju-core/cmd"
"launchpad.net/juju-core/environs"
@@ -65,6 +67,12 @@
}
// Otherwise, look up the best supported series for this charm
if series == "" {
+ if ref.Schema == "local" {
+ possibleUrl := &charm.URL{Reference: ref, Series: "precise"}
+ logger.Errorf(`The series is not specified in the environment
(default-series) or with the charm. Did you mean:
+ %s`, possibleUrl.String())
+ return nil, fmt.Errorf("cannot resolve series for charm: %q", ref)
+ }
return client.ResolveCharm(ref)
}
return &charm.URL{Reference: ref, Series: series}, nil
-For local:precise/mysql
- local:mysql
-
-In all cases, a versioned charm URL will be expanded as expected (for
example,
+In these cases, a versioned charm URL will be expanded as expected (for
example,
mysql-33 becomes cs:precise/mysql-33).
+However, for local charms, such as local:precise/mysql, one must specify
the
+series.
+
<service name>, if omitted, will be derived from <charm name>.
Constraints can be specified when using deploy by specifying the
--constraints
Reviewers: mp+215021_ code.launchpad. net,
Message:
Please take a look.
Description:
Error msg for local charm deploy missing series.
Add error message when unable to resolve series for local repository.
Update juju deploy doc message to describe behavior.
https:/ /code.launchpad .net/~cmars/ juju-core/ local-repo- errmsg/ +merge/ 215021
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/86160043/
Affected files (+14, -4 lines):
A [revision details]
M cmd/juju/common.go
M cmd/juju/deploy.go
Index: [revision details] 20140409180231- hnxao50offx5c4c 9
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: cmd/juju/common.go common. go'
=== modified file 'cmd/juju/
--- cmd/juju/common.go 2014-04-07 10:05:04 +0000
+++ cmd/juju/common.go 2014-04-09 19:31:16 +0000
@@ -4,6 +4,8 @@
package main
import ( net/juju- core/charm" net/juju- core/cmd" net/juju- core/environs" URL{Reference: ref, Series: "precise"} String( )) ResolveCharm( ref) URL{Reference: ref, Series: series}, nil
+ "fmt"
+
"launchpad.
"launchpad.
"launchpad.
@@ -65,6 +67,12 @@
}
// Otherwise, look up the best supported series for this charm
if series == "" {
+ if ref.Schema == "local" {
+ possibleUrl := &charm.
+ logger.Errorf(`The series is not specified in the environment
(default-series) or with the charm. Did you mean:
+ %s`, possibleUrl.
+ return nil, fmt.Errorf("cannot resolve series for charm: %q", ref)
+ }
return client.
}
return &charm.
Index: cmd/juju/deploy.go deploy. go' precise/ mysql
=== modified file 'cmd/juju/
--- cmd/juju/deploy.go 2014-04-09 06:35:07 +0000
+++ cmd/juju/deploy.go 2014-04-09 19:31:16 +0000
@@ -49,12 +49,12 @@
For cs:~user/
cs:~user/mysql
-For local:precise/mysql mysql-33) .
- local:mysql
-
-In all cases, a versioned charm URL will be expanded as expected (for
example,
+In these cases, a versioned charm URL will be expanded as expected (for
example,
mysql-33 becomes cs:precise/
+However, for local charms, such as local:precise/ mysql, one must specify
the
+series.
+
<service name>, if omitted, will be derived from <charm name>.
Constraints can be specified when using deploy by specifying the
--constraints