-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
# * limitations under the License. | ||
|
||
from cloudify import ctx | ||
from cloudify.exceptions import RecoverableError | ||
from openstack_plugin_common import ( | ||
delete_resource_and_runtime_properties, | ||
use_external_resource, | ||
|
@@ -22,7 +23,6 @@ | |
OPENSTACK_ID_PROPERTY, | ||
OPENSTACK_TYPE_PROPERTY) | ||
|
||
|
||
FLOATINGIP_OPENSTACK_TYPE = 'floatingip' | ||
|
||
# Runtime properties | ||
|
@@ -35,6 +35,12 @@ def use_external_floatingip(client, ip_field_name, ext_fip_ip_extractor): | |
external_fip = use_external_resource( | ||
ctx, client, FLOATINGIP_OPENSTACK_TYPE, ip_field_name) | ||
if external_fip: | ||
if ctx.node.properties['allow_reallocation'] \ | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
isaac-s
Author
Contributor
|
||
and external_fip['status'] == 'ACTIVE': | ||
raise RecoverableError( | ||
'Floating IP address {0} is already associated'.format( | ||
external_fip['floating_ip_address']) | ||
) | ||
ctx.instance.runtime_properties[IP_ADDRESS_PROPERTY] = \ | ||
ext_fip_ip_extractor(external_fip) | ||
return True | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@isaac-s based on your defining the
allow_reallocation
The condition must be
if not ctx.node.properties['allow_reallocation'] and external_fip['status'] == 'ACTIVE'