Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2)

Unified Diff: cmd/juju/environment.go

Issue 92140043: Init EnvCommandBase.EnvName from envs.yaml
Patch Set: Init EnvCommandBase.EnvName from envs.yaml Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cmd/juju/endpoint.go ('k') | cmd/juju/expose.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cmd/juju/environment.go
=== modified file 'cmd/juju/environment.go'
--- cmd/juju/environment.go 2014-03-26 06:32:05 +0000
+++ cmd/juju/environment.go 2014-05-09 02:38:55 +0000
@@ -10,6 +10,7 @@
"launchpad.net/gnuflag"
"launchpad.net/juju-core/cmd"
+ "launchpad.net/juju-core/cmd/envcmd"
"launchpad.net/juju-core/juju"
"launchpad.net/juju-core/state/api/params"
)
@@ -17,7 +18,7 @@
// GetEnvironmentCommand is able to output either the entire environment or
// the requested value in a format of the user's choosing.
type GetEnvironmentCommand struct {
- cmd.EnvCommandBase
+ envcmd.EnvCommandBase
key string
out cmd.Output
}
@@ -50,6 +51,9 @@
}
func (c *GetEnvironmentCommand) Init(args []string) (err error) {
+ if err := c.EnvCommandBase.EnsureEnvName(); err != nil {
+ return err
+ }
c.key, err = cmd.ZeroOrOneArgs(args)
return
}
@@ -105,7 +109,7 @@
// SetEnvironment
type SetEnvironmentCommand struct {
- cmd.EnvCommandBase
+ envcmd.EnvCommandBase
values attributes
}
@@ -124,9 +128,12 @@
}
}
-// SetFlags handled entirely by cmd.EnvCommandBase
+// SetFlags handled entirely by envcmd.EnvCommandBase
func (c *SetEnvironmentCommand) Init(args []string) (err error) {
+ if err := c.EnsureEnvName(); err != nil {
+ return err
+ }
if len(args) == 0 {
return fmt.Errorf("No key, value pairs specified")
}
@@ -184,7 +191,7 @@
// UnsetEnvironment
type UnsetEnvironmentCommand struct {
- cmd.EnvCommandBase
+ envcmd.EnvCommandBase
keys []string
}
@@ -208,6 +215,9 @@
}
func (c *UnsetEnvironmentCommand) Init(args []string) (err error) {
+ if err := c.EnsureEnvName(); err != nil {
+ return err
+ }
if len(args) == 0 {
return fmt.Errorf("No keys specified")
}
« no previous file with comments | « cmd/juju/endpoint.go ('k') | cmd/juju/expose.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b