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

Side by Side Diff: provider/azure/environ.go

Issue 14433058: Providers are responsible for selecting tools
Patch Set: Providers are responsible for selecting tools Created 11 years, 4 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 | « environs/tools/tools_test.go ('k') | provider/azure/environ_test.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 azure 4 package azure
5 5
6 import ( 6 import (
7 "fmt" 7 "fmt"
8 "net/http" 8 "net/http"
9 "sync" 9 "sync"
10 "time" 10 "time"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 return azure.RemoveVirtualNetworkSite(vnetName) 238 return azure.RemoveVirtualNetworkSite(vnetName)
239 } 239 }
240 240
241 // getContainerName returns the name of the private storage account container 241 // getContainerName returns the name of the private storage account container
242 // that this environment is using. 242 // that this environment is using.
243 func (env *azureEnviron) getContainerName() string { 243 func (env *azureEnviron) getContainerName() string {
244 return env.getEnvPrefix() + "private" 244 return env.getEnvPrefix() + "private"
245 } 245 }
246 246
247 // Bootstrap is specified in the Environ interface. 247 // Bootstrap is specified in the Environ interface.
248 func (env *azureEnviron) Bootstrap(cons constraints.Value, possibleTools tools.L ist) (err error) { 248 func (env *azureEnviron) Bootstrap(cons constraints.Value) (err error) {
249 // The creation of the affinity group and the virtual network is specifi c to the Azure provider. 249 // The creation of the affinity group and the virtual network is specifi c to the Azure provider.
250 err = env.createAffinityGroup() 250 err = env.createAffinityGroup()
251 if err != nil { 251 if err != nil {
252 return err 252 return err
253 } 253 }
254 // If we fail after this point, clean up the affinity group. 254 // If we fail after this point, clean up the affinity group.
255 defer func() { 255 defer func() {
256 if err != nil { 256 if err != nil {
257 env.deleteAffinityGroup() 257 env.deleteAffinityGroup()
258 } 258 }
259 }() 259 }()
260 err = env.createVirtualNetwork() 260 err = env.createVirtualNetwork()
261 if err != nil { 261 if err != nil {
262 return err 262 return err
263 } 263 }
264 // If we fail after this point, clean up the virtual network. 264 // If we fail after this point, clean up the virtual network.
265 defer func() { 265 defer func() {
266 if err != nil { 266 if err != nil {
267 env.deleteVirtualNetwork() 267 env.deleteVirtualNetwork()
268 } 268 }
269 }() 269 }()
270 » err = common.Bootstrap(env, cons, possibleTools) 270 » err = common.Bootstrap(env, cons)
271 return err 271 return err
272 } 272 }
273 273
274 // StateInfo is specified in the Environ interface. 274 // StateInfo is specified in the Environ interface.
275 func (env *azureEnviron) StateInfo() (*state.Info, *api.Info, error) { 275 func (env *azureEnviron) StateInfo() (*state.Info, *api.Info, error) {
276 return common.StateInfo(env) 276 return common.StateInfo(env)
277 } 277 }
278 278
279 // Config is specified in the Environ interface. 279 // Config is specified in the Environ interface.
280 func (env *azureEnviron) Config() *config.Config { 280 func (env *azureEnviron) Config() *config.Config {
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 } 943 }
944 944
945 // Region is specified in the HasRegion interface. 945 // Region is specified in the HasRegion interface.
946 func (env *azureEnviron) Region() (simplestreams.CloudSpec, error) { 946 func (env *azureEnviron) Region() (simplestreams.CloudSpec, error) {
947 ecfg := env.getSnapshot().ecfg 947 ecfg := env.getSnapshot().ecfg
948 return simplestreams.CloudSpec{ 948 return simplestreams.CloudSpec{
949 Region: ecfg.location(), 949 Region: ecfg.location(),
950 Endpoint: string(gwacl.GetEndpoint(ecfg.location())), 950 Endpoint: string(gwacl.GetEndpoint(ecfg.location())),
951 }, nil 951 }, nil
952 } 952 }
OLDNEW
« no previous file with comments | « environs/tools/tools_test.go ('k') | provider/azure/environ_test.go » ('j') | no next file with comments »

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