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

Side by Side Diff: cmd/juju/environment.go

Issue 12546043: return error on no environment
Patch Set: return error on no environment Created 10 years, 7 months ago
Left:
Right:
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 unified diff | Download patch
« no previous file with comments | « cmd/juju/destroyunit.go ('k') | cmd/juju/environmentcommand.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 Canonical Ltd. 1 // Copyright 2013 Canonical Ltd.
2 // Licensed under the AGPLv3, see LICENCE file for details. 2 // Licensed under the AGPLv3, see LICENCE file for details.
3 3
4 package main 4 package main
5 5
6 import ( 6 import (
7 "fmt" 7 "fmt"
8 "strings"
9
8 "launchpad.net/gnuflag" 10 "launchpad.net/gnuflag"
11
9 "launchpad.net/juju-core/cmd" 12 "launchpad.net/juju-core/cmd"
10 "launchpad.net/juju-core/juju" 13 "launchpad.net/juju-core/juju"
11 "strings"
12 ) 14 )
13 15
14 // GetEnvironmentCommand is able to output either the entire environment or 16 // GetEnvironmentCommand is able to output either the entire environment or
15 // the requested value in a format of the user's choosing. 17 // the requested value in a format of the user's choosing.
16 type GetEnvironmentCommand struct { 18 type GetEnvironmentCommand struct {
17 EnvCommandBase 19 EnvCommandBase
18 key string 20 key string
19 out cmd.Output 21 out cmd.Output
20 } 22 }
21 23
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 } 149 }
148 // Now validate this new config against the existing config via the prov ider. 150 // Now validate this new config against the existing config via the prov ider.
149 provider := conn.Environ.Provider() 151 provider := conn.Environ.Provider()
150 newProviderConfig, err := provider.Validate(newConfig, oldConfig) 152 newProviderConfig, err := provider.Validate(newConfig, oldConfig)
151 if err != nil { 153 if err != nil {
152 return err 154 return err
153 } 155 }
154 // Now try to apply the new validated config. 156 // Now try to apply the new validated config.
155 return conn.State.SetEnvironConfig(newProviderConfig) 157 return conn.State.SetEnvironConfig(newProviderConfig)
156 } 158 }
OLDNEW
« no previous file with comments | « cmd/juju/destroyunit.go ('k') | cmd/juju/environmentcommand.go » ('j') | no next file with comments »

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