OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |