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

Delta Between Two Patch Sets: environs/azure/environ.go

Issue 10500043: environ.StateInfo() for Azure provider. (Closed)
Left Patch Set: environ.StateInfo() for Azure provider. Created 11 years, 9 months ago
Right Patch Set: environ.StateInfo() for Azure provider. Created 11 years, 9 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « [revision details] ('k') | environs/azure/environ_test.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 "launchpad.net/gwacl" 8 "launchpad.net/gwacl"
9 "launchpad.net/juju-core/constraints" 9 "launchpad.net/juju-core/constraints"
10 "launchpad.net/juju-core/environs" 10 "launchpad.net/juju-core/environs"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 snap.Mutex = sync.Mutex{} 93 snap.Mutex = sync.Mutex{}
94 return &snap 94 return &snap
95 } 95 }
96 96
97 // Bootstrap is specified in the Environ interface. 97 // Bootstrap is specified in the Environ interface.
98 func (env *azureEnviron) Bootstrap(cons constraints.Value) error { 98 func (env *azureEnviron) Bootstrap(cons constraints.Value) error {
99 panic("unimplemented") 99 panic("unimplemented")
100 } 100 }
101 101
102 // StateInfo is specified in the Environ interface. 102 // StateInfo is specified in the Environ interface.
103 // TODO: This function is duplicated between the EC2, OpenStack, MAAS, and
104 // Azure providers (bug 1195721).
103 func (env *azureEnviron) StateInfo() (*state.Info, *api.Info, error) { 105 func (env *azureEnviron) StateInfo() (*state.Info, *api.Info, error) {
104 // This code is cargo-culted from the ec2/maas/openstack providers. 106 // This code is cargo-culted from the ec2/maas/openstack providers.
105 // It's not clear that the longAttempt loop has any business being 107 // It's not clear that the longAttempt loop has any business being
106 // here, but it's probably a refactoring that needs to happen outside 108 // here, but it's probably a refactoring that needs to happen outside
107 // of the provider code. 109 // of the provider code.
108 st, err := env.loadState() 110 st, err := env.loadState()
109 if err != nil { 111 if err != nil {
110 return nil, nil, err 112 return nil, nil, err
111 } 113 }
112 config := env.Config() 114 config := env.Config()
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 // Azure's storage API (public storage). 310 // Azure's storage API (public storage).
309 func (env *azureEnviron) getPublicStorageContext() (*gwacl.StorageContext, error ) { 311 func (env *azureEnviron) getPublicStorageContext() (*gwacl.StorageContext, error ) {
310 ecfg := env.getSnapshot().ecfg 312 ecfg := env.getSnapshot().ecfg
311 context := gwacl.StorageContext{ 313 context := gwacl.StorageContext{
312 Account: ecfg.PublicStorageAccountName(), 314 Account: ecfg.PublicStorageAccountName(),
313 Key: "", // Empty string means anonymous access. 315 Key: "", // Empty string means anonymous access.
314 } 316 }
315 // There is currently no way for this to fail. 317 // There is currently no way for this to fail.
316 return &context, nil 318 return &context, nil
317 } 319 }
LEFTRIGHT

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