diff options
author | 2017-12-19 10:18:41 +0100 | |
---|---|---|
committer | 2017-12-19 16:29:37 +0000 | |
commit | 345cc4e80de42729f62bd2c5cfe6a2e31273ac4d (patch) | |
tree | 85e6563f00e235870a7778cd60cf5051a01b97f7 | |
parent | dc6699282623b5cb3e0df80f8687b8e1333e88bd (diff) |
Return the floating ip object
Sometimes it might be useful to have the floating ip object which was assigned
Change-Id: I883ec2af448cd38dad2e0d24843c92e7ab495c2f
Signed-off-by: Manuel Buil <mbuil@suse.com>
-rw-r--r-- | snaps/openstack/create_instance.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/snaps/openstack/create_instance.py b/snaps/openstack/create_instance.py index 8e3eb01..336c936 100644 --- a/snaps/openstack/create_instance.py +++ b/snaps/openstack/create_instance.py @@ -196,6 +196,7 @@ class OpenStackVmInstance(OpenStackComputeObject): """ Adds a floating IP to a running instance :param floating_ip_setting - the floating IP configuration + :return: the floating ip object """ port_dict = dict() for key, port in self.__ports: @@ -225,6 +226,7 @@ class OpenStackVmInstance(OpenStackComputeObject): 'Created floating IP %s via router - %s', floating_ip.ip, floating_ip_setting.router_name) self.__add_floating_ip(floating_ip, port, subnet) + return floating_ip else: raise VmInstanceCreationError( 'Unable to add floating IP to port, cannot locate router ' |