Skip to content
This repository was archived by the owner on May 10, 2024. It is now read-only.

Commit dd7774c

Browse files
committed
Merge branch 'ec2-dry-run' into develop
2 parents 6c5a394 + 530b1aa commit dd7774c

19 files changed

+1286
-336
lines changed

boto/ec2/address.py

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,33 +71,50 @@ def endElement(self, name, value, connection):
7171
else:
7272
setattr(self, name, value)
7373

74-
def release(self):
74+
def release(self, dry_run=False):
7575
"""
7676
Free up this Elastic IP address.
7777
:see: :meth:`boto.ec2.connection.EC2Connection.release_address`
7878
"""
7979
if self.allocation_id:
80-
return self.connection.release_address(None, self.allocation_id)
80+
return self.connection.release_address(
81+
None,
82+
self.allocation_id,
83+
dry_run=dry_run)
8184
else:
82-
return self.connection.release_address(self.public_ip)
85+
return self.connection.release_address(
86+
self.public_ip,
87+
dry_run=dry_run
88+
)
8389

8490
delete = release
8591

86-
def associate(self, instance_id):
92+
def associate(self, instance_id, dry_run=False):
8793
"""
8894
Associate this Elastic IP address with a currently running instance.
8995
:see: :meth:`boto.ec2.connection.EC2Connection.associate_address`
9096
"""
91-
return self.connection.associate_address(instance_id, self.public_ip)
97+
return self.connection.associate_address(
98+
instance_id,
99+
self.public_ip,
100+
dry_run=dry_run
101+
)
92102

93-
def disassociate(self):
103+
def disassociate(self, dry_run=False):
94104
"""
95105
Disassociate this Elastic IP address from a currently running instance.
96106
:see: :meth:`boto.ec2.connection.EC2Connection.disassociate_address`
97107
"""
98108
if self.association_id:
99-
return self.connection.disassociate_address(None, self.association_id)
109+
return self.connection.disassociate_address(
110+
None,
111+
self.association_id,
112+
dry_run=dry_run
113+
)
100114
else:
101-
return self.connection.disassociate_address(self.public_ip)
115+
return self.connection.disassociate_address(
116+
self.public_ip,
117+
dry_run=dry_run
118+
)
102119

103120

0 commit comments

Comments
 (0)