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

Delta Between Two Patch Sets: juju/providers/ec2/tests/common.py

Issue 6850044: providers/ec2: support VPC
Left Patch Set: providers/ec2: support VPC Created 12 years, 4 months ago
Right Patch Set: providers/ec2: support VPC Created 12 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « juju/providers/ec2/securitygroup.py ('k') | juju/providers/ec2/tests/data/bootstrap_cloud_init » ('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 1
2 from twisted.internet.defer import fail, succeed, inlineCallbacks, returnValue 2 from twisted.internet.defer import fail, succeed, inlineCallbacks, returnValue
3 3
4 from txaws.s3.client import S3Client 4 from txaws.s3.client import S3Client
5 from txaws.s3.exception import S3Error 5 from txaws.s3.exception import S3Error
6 from txaws.ec2.client import EC2Client 6 from txaws.ec2.client import EC2Client
7 from txaws.ec2.exception import EC2Error 7 from txaws.ec2.exception import EC2Error
8 from txaws.ec2.model import Instance, Reservation, SecurityGroup 8 from txaws.ec2.model import Instance, Reservation, SecurityGroup
9 9
10 from juju.lib import serializer 10 from juju.lib import serializer
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 """Return the ec2 machine provider. 42 """Return the ec2 machine provider.
43 43
44 This should only be invoked after mocker is in replay mode so the 44 This should only be invoked after mocker is in replay mode so the
45 AWS service class will be appropriately replaced by the mock. 45 AWS service class will be appropriately replaced by the mock.
46 """ 46 """
47 return MachineProvider(self.env_name, self.get_config()) 47 return MachineProvider(self.env_name, self.get_config())
48 48
49 def get_instance(self, 49 def get_instance(self,
50 instance_id, state="running", machine_id=42, **kwargs): 50 instance_id, state="running", machine_id=42, **kwargs):
51 groups = kwargs.pop("groups", 51 groups = kwargs.pop("groups",
52 ["juju-%s" % self.env_name, 52 [("sg-a1a1a1", "juju-%s" % self.env_name),
53 "juju-%s-%s" % (self.env_name, machine_id)]) 53 ("sg-b2b2b2", "juju-%s-%s" % (self.env_name, machin e_id))])
54 reservation = Reservation("x", "y", groups=groups) 54 reservation = Reservation("x", "y", groups=groups)
55 return Instance(instance_id, state, reservation=reservation, **kwargs) 55 return Instance(instance_id, state, reservation=reservation, **kwargs)
56 56
57 def assert_machine(self, machine, instance_id, dns_name): 57 def assert_machine(self, machine, instance_id, dns_name):
58 self.assertTrue(isinstance(machine, EC2ProviderMachine)) 58 self.assertTrue(isinstance(machine, EC2ProviderMachine))
59 self.assertEquals(machine.instance_id, instance_id) 59 self.assertEquals(machine.instance_id, instance_id)
60 self.assertEquals(machine.dns_name, dns_name) 60 self.assertEquals(machine.dns_name, dns_name)
61 61
62 def get_ec2_error(self, entity_id, 62 def get_ec2_error(self, entity_id,
63 format="The instance ID %r does not exist", 63 format="The instance ID %r does not exist",
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 201
202 class Observed(object): 202 class Observed(object):
203 """Minimal wrapper just to ensure :method:`add` returns a `Deferred`.""" 203 """Minimal wrapper just to ensure :method:`add` returns a `Deferred`."""
204 204
205 def __init__(self): 205 def __init__(self):
206 self.items = set() 206 self.items = set()
207 207
208 def add(self, item): 208 def add(self, item):
209 self.items.add(item) 209 self.items.add(item)
210 return succeed(True) 210 return succeed(True)
LEFTRIGHT

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