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

Delta Between Two Patch Sets: environs/ec2/export_test.go

Issue 9738043: cmd/jujud: do not change password
Left Patch Set: cmd/jujud: do not change password Created 11 years, 10 months ago
Right Patch Set: cmd/jujud: do not change password 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:
Right: Side by side diff | Download
« no previous file with change/comment | « environs/ec2/ec2.go ('k') | environs/ec2/image_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
(no file at all)
1 // Copyright 2012, 2013 Canonical Ltd. 1 // Copyright 2012, 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 ec2 4 package ec2
5 5
6 import ( 6 import (
7 "io" 7 "io"
8 "launchpad.net/goamz/aws" 8 "launchpad.net/goamz/aws"
9 "launchpad.net/goamz/ec2" 9 "launchpad.net/goamz/ec2"
10 "launchpad.net/goamz/s3" 10 "launchpad.net/goamz/s3"
11 "launchpad.net/juju-core/environs" 11 "launchpad.net/juju-core/environs"
12 "launchpad.net/juju-core/environs/imagemetadata" 12 "launchpad.net/juju-core/environs/imagemetadata"
13 "launchpad.net/juju-core/environs/jujutest" 13 "launchpad.net/juju-core/environs/jujutest"
14 » "launchpad.net/juju-core/state" 14 » "launchpad.net/juju-core/instance"
15 "launchpad.net/juju-core/utils" 15 "launchpad.net/juju-core/utils"
16 "net/http" 16 "net/http"
17 ) 17 )
18 18
19 type BootstrapState struct { 19 type BootstrapState struct {
20 » StateInstances []state.InstanceId 20 » StateInstances []instance.Id
21 } 21 }
22 22
23 func LoadState(e environs.Environ) (*BootstrapState, error) { 23 func LoadState(e environs.Environ) (*BootstrapState, error) {
24 s, err := e.(*environ).loadState() 24 s, err := e.(*environ).loadState()
25 if err != nil { 25 if err != nil {
26 return nil, err 26 return nil, err
27 } 27 }
28 return &BootstrapState{s.StateInstances}, nil 28 return &BootstrapState{s.StateInstances}, nil
29 } 29 }
30 30
(...skipping 10 matching lines...) Expand all
41 } 41 }
42 42
43 func EnvironS3(e environs.Environ) *s3.S3 { 43 func EnvironS3(e environs.Environ) *s3.S3 {
44 return e.(*environ).s3() 44 return e.(*environ).s3()
45 } 45 }
46 46
47 func DeleteStorageContent(s environs.Storage) error { 47 func DeleteStorageContent(s environs.Storage) error {
48 return s.(*storage).deleteAll() 48 return s.(*storage).deleteAll()
49 } 49 }
50 50
51 func InstanceEC2(inst environs.Instance) *ec2.Instance { 51 func InstanceEC2(inst instance.Instance) *ec2.Instance {
52 » return inst.(*instance).Instance 52 » return inst.(*ec2Instance).Instance
53 } 53 }
54 54
55 // BucketStorage returns a storage instance addressing 55 // BucketStorage returns a storage instance addressing
56 // an arbitrary s3 bucket. 56 // an arbitrary s3 bucket.
57 func BucketStorage(b *s3.Bucket) environs.Storage { 57 func BucketStorage(b *s3.Bucket) environs.Storage {
58 return &storage{ 58 return &storage{
59 bucket: b, 59 bucket: b,
60 } 60 }
61 } 61 }
62 62
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } 140 }
141 141
142 var ShortAttempt = &shortAttempt 142 var ShortAttempt = &shortAttempt
143 143
144 func EC2ErrCode(err error) string { 144 func EC2ErrCode(err error) string {
145 return ec2ErrCode(err) 145 return ec2ErrCode(err)
146 } 146 }
147 147
148 // FabricateInstance creates a new fictitious instance 148 // FabricateInstance creates a new fictitious instance
149 // given an existing instance and a new id. 149 // given an existing instance and a new id.
150 func FabricateInstance(inst environs.Instance, newId string) environs.Instance { 150 func FabricateInstance(inst instance.Instance, newId string) instance.Instance {
151 » oldi := inst.(*instance) 151 » oldi := inst.(*ec2Instance)
152 » newi := &instance{oldi.e, &ec2.Instance{}} 152 » newi := &ec2Instance{
153 » » e: oldi.e,
154 » » Instance: &ec2.Instance{},
155 » » arch: oldi.arch,
156 » » instType: oldi.instType,
157 » }
153 *newi.Instance = *oldi.Instance 158 *newi.Instance = *oldi.Instance
154 newi.InstanceId = newId 159 newi.InstanceId = newId
155 return newi 160 return newi
156 } 161 }
157 162
158 // Access non exported methods on ec2.storage 163 // Access non exported methods on ec2.storage
159 type Storage interface { 164 type Storage interface {
160 Put(file string, r io.Reader, length int64) error 165 Put(file string, r io.Reader, length int64) error
161 ResetMadeBucket() 166 ResetMadeBucket()
162 } 167 }
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 "m1.large": 240, 389 "m1.large": 240,
385 "m1.xlarge": 480, 390 "m1.xlarge": 480,
386 "t1.micro": 20, 391 "t1.micro": 20,
387 "c1.medium": 145, 392 "c1.medium": 145,
388 "c1.xlarge": 580, 393 "c1.xlarge": 580,
389 "cc1.4xlarge": 1300, 394 "cc1.4xlarge": 1300,
390 "cc2.8xlarge": 2400, 395 "cc2.8xlarge": 2400,
391 } 396 }
392 397
393 var TestRegions = map[string]aws.Region{ 398 var TestRegions = map[string]aws.Region{
394 » "test": aws.Region{ 399 » "test": {
395 Name: "test", 400 Name: "test",
396 EC2Endpoint: "https://ec2.endpoint.com", 401 EC2Endpoint: "https://ec2.endpoint.com",
397 }, 402 },
398 } 403 }
LEFTRIGHT

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