Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 package ec2 | 1 package ec2 |
2 | 2 |
3 import ( | 3 import ( |
4 "fmt" | 4 "fmt" |
5 "io/ioutil" | 5 "io/ioutil" |
6 "launchpad.net/goamz/aws" | 6 "launchpad.net/goamz/aws" |
7 "launchpad.net/goamz/ec2" | 7 "launchpad.net/goamz/ec2" |
8 "launchpad.net/goamz/s3" | 8 "launchpad.net/goamz/s3" |
9 "launchpad.net/juju-core/environs" | 9 "launchpad.net/juju-core/environs" |
10 "launchpad.net/juju-core/environs/cloudinit" | 10 "launchpad.net/juju-core/environs/cloudinit" |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
241 if err != nil { | 241 if err != nil { |
242 return fmt.Errorf("cannot find tools: %v", err) | 242 return fmt.Errorf("cannot find tools: %v", err) |
243 } | 243 } |
244 } | 244 } |
245 config, err := environs.BootstrapConfig(providerInstance, e.Config(), to ols) | 245 config, err := environs.BootstrapConfig(providerInstance, e.Config(), to ols) |
246 if err != nil { | 246 if err != nil { |
247 return fmt.Errorf("unable to determine inital configuration: %v" , err) | 247 return fmt.Errorf("unable to determine inital configuration: %v" , err) |
248 } | 248 } |
249 caCert, hasCert := e.Config().CACert() | 249 caCert, hasCert := e.Config().CACert() |
250 if !hasCert { | 250 if !hasCert { |
251 » » return fmt.Errorf("environ config has no CA certificate") | 251 » » return fmt.Errorf("no CA certificate in environment configuratio n") |
niemeyer
2012/11/27 19:35:23
"no CA certificate in environment configuration" (
| |
252 } | 252 } |
253 info := &state.Info{ | 253 info := &state.Info{ |
254 Password: trivial.PasswordHash(password), | 254 Password: trivial.PasswordHash(password), |
255 CACert: caCert, | 255 CACert: caCert, |
256 } | 256 } |
257 inst, err := e.startInstance(&startInstanceParams{ | 257 inst, err := e.startInstance(&startInstanceParams{ |
258 machineId: 0, | 258 machineId: 0, |
259 info: info, | 259 info: info, |
260 tools: tools, | 260 tools: tools, |
261 stateServer: true, | 261 stateServer: true, |
(...skipping 22 matching lines...) Expand all Loading... | |
284 return nil | 284 return nil |
285 } | 285 } |
286 | 286 |
287 func (e *environ) StateInfo() (*state.Info, error) { | 287 func (e *environ) StateInfo() (*state.Info, error) { |
288 st, err := e.loadState() | 288 st, err := e.loadState() |
289 if err != nil { | 289 if err != nil { |
290 return nil, err | 290 return nil, err |
291 } | 291 } |
292 cert, hasCert := e.Config().CACert() | 292 cert, hasCert := e.Config().CACert() |
293 if !hasCert { | 293 if !hasCert { |
294 » » return nil, fmt.Errorf("environ config has no CA certificate") | 294 » » return nil, fmt.Errorf("no CA certificate in environment configu ration") |
niemeyer
2012/11/27 19:35:23
"no CA certificate in environment configuration" (
| |
295 } | 295 } |
296 var addrs []string | 296 var addrs []string |
297 // Wait for the DNS names of any of the instances | 297 // Wait for the DNS names of any of the instances |
298 // to become available. | 298 // to become available. |
299 log.Printf("environs/ec2: waiting for DNS name(s) of state server instan ces %v", st.StateInstances) | 299 log.Printf("environs/ec2: waiting for DNS name(s) of state server instan ces %v", st.StateInstances) |
300 for a := longAttempt.Start(); len(addrs) == 0 && a.Next(); { | 300 for a := longAttempt.Start(); len(addrs) == 0 && a.Next(); { |
301 insts, err := e.Instances(st.StateInstances) | 301 insts, err := e.Instances(st.StateInstances) |
302 if err != nil && err != environs.ErrPartialInstances { | 302 if err != nil && err != environs.ErrPartialInstances { |
303 return nil, err | 303 return nil, err |
304 } | 304 } |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
960 } | 960 } |
961 var data []byte | 961 var data []byte |
962 data, err = ioutil.ReadAll(resp.Body) | 962 data, err = ioutil.ReadAll(resp.Body) |
963 if err != nil { | 963 if err != nil { |
964 continue | 964 continue |
965 } | 965 } |
966 return strings.TrimSpace(string(data)), nil | 966 return strings.TrimSpace(string(data)), nil |
967 } | 967 } |
968 return | 968 return |
969 } | 969 } |
LEFT | RIGHT |