LEFT | RIGHT |
1 package ec2 | 1 package ec2 |
2 | 2 |
3 import ( | 3 import ( |
4 "launchpad.net/goamz/ec2" | 4 "launchpad.net/goamz/ec2" |
5 "launchpad.net/goamz/s3" | 5 "launchpad.net/goamz/s3" |
6 "launchpad.net/juju-core/environs" | 6 "launchpad.net/juju-core/environs" |
7 "launchpad.net/juju-core/trivial" | 7 "launchpad.net/juju-core/trivial" |
8 "net/http" | 8 "net/http" |
9 ) | 9 ) |
10 | 10 |
11 type BootstrapState struct { | 11 type BootstrapState struct { |
12 StateInstances []string | 12 StateInstances []string |
13 } | 13 } |
14 | 14 |
15 func LoadState(e environs.Environ) (*BootstrapState, error) { | 15 func LoadState(e environs.Environ) (*BootstrapState, error) { |
16 s, err := e.(*environ).loadState() | 16 s, err := e.(*environ).loadState() |
17 if err != nil { | 17 if err != nil { |
18 return nil, err | 18 return nil, err |
19 } | 19 } |
20 return &BootstrapState{s.StateInstances}, nil | 20 return &BootstrapState{s.StateInstances}, nil |
21 } | 21 } |
22 | 22 |
23 func GroupName(e environs.Environ) string { | 23 func JujuGroupName(e environs.Environ) string { |
24 » return e.(*environ).groupName() | 24 » return e.(*environ).jujuGroupName() |
25 } | 25 } |
26 | 26 |
27 func MachineGroupName(e environs.Environ, machineId int) string { | 27 func MachineGroupName(e environs.Environ, machineId int) string { |
28 return e.(*environ).machineGroupName(machineId) | 28 return e.(*environ).machineGroupName(machineId) |
29 } | 29 } |
30 | 30 |
31 func EnvironEC2(e environs.Environ) *ec2.EC2 { | 31 func EnvironEC2(e environs.Environ) *ec2.EC2 { |
32 return e.(*environ).ec2() | 32 return e.(*environ).ec2() |
33 } | 33 } |
34 | 34 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 // FabricateInstance creates a new fictitious instance | 107 // FabricateInstance creates a new fictitious instance |
108 // given an existing instance and a new id. | 108 // given an existing instance and a new id. |
109 func FabricateInstance(inst environs.Instance, newId string) environs.Instance { | 109 func FabricateInstance(inst environs.Instance, newId string) environs.Instance { |
110 oldi := inst.(*instance) | 110 oldi := inst.(*instance) |
111 newi := &instance{oldi.e, &ec2.Instance{}} | 111 newi := &instance{oldi.e, &ec2.Instance{}} |
112 *newi.Instance = *oldi.Instance | 112 *newi.Instance = *oldi.Instance |
113 newi.InstanceId = newId | 113 newi.InstanceId = newId |
114 return newi | 114 return newi |
115 } | 115 } |
LEFT | RIGHT |