Add the ability to pass pool for AddPublicIP
Change-Id: Idb4ca5ce32a3ac0dd9aa8c2ad391479f0089de03 Signed-off-by: Paul Belanger <paul.belanger@polybeacon.com>
This commit is contained in:
parent
629f224ea6
commit
84feb392a2
|
@ -128,7 +128,7 @@ class DeleteKeypairTask(Task):
|
|||
|
||||
class CreateFloatingIPTask(Task):
|
||||
def main(self, client):
|
||||
ip = client.floating_ips.create()
|
||||
ip = client.floating_ips.create(**self.args)
|
||||
return dict(id=ip.id, ip=ip.ip)
|
||||
|
||||
|
||||
|
@ -325,15 +325,15 @@ class ProviderManager(TaskManager):
|
|||
def waitForImage(self, image_id, timeout=3600):
|
||||
return self._waitForResource('image', image_id, timeout)
|
||||
|
||||
def createFloatingIP(self):
|
||||
return self.submitTask(CreateFloatingIPTask())
|
||||
def createFloatingIP(self, pool=None):
|
||||
return self.submitTask(CreateFloatingIPTask(pool=pool))
|
||||
|
||||
def addFloatingIP(self, server_id, address):
|
||||
self.submitTask(AddFloatingIPTask(server=server_id,
|
||||
address=address))
|
||||
|
||||
def addPublicIP(self, server_id):
|
||||
ip = self.createFloatingIP()
|
||||
def addPublicIP(self, server_id, pool=None):
|
||||
ip = self.createFloatingIP(pool)
|
||||
self.addFloatingIP(server_id, ip['ip'])
|
||||
for count in iterate_timeout(600, "ip to be added"):
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue