def get_object_display(self, datum):
return datum.ip
diff --git a/horizon/dashboards/nova/access_and_security/floating_ips/utils.py b/horizon/dashboards/nova/access_and_security/floating_ips/utils.py
new file mode 100644
index 0000000..b61b8b3
--- /dev/null
+++ b/horizon/dashboards/nova/access_and_security/floating_ips/utils.py
@@ -0,0 +1,32 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright 2012 NEC Corporation All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+import uuid
+
+
+def get_int_or_uuid(value):
+ """Check if a value is valid as UUID or an integer.
+
+ This method is mainly used to convert floating IP id to the
+ appropriate type. For floating IP id, integer is used in Nova's
+ original implementation, but UUID is used in Quantum based one.
+ """
+ try:
+ uuid.UUID(value)
+ return value
+ except (ValueError, AttributeError):
+ return int(value)
+
diff --git a/horizon/dashboards/nova/access_and_security/floating_ips/workflows.py b/horizon/dashboards/nova/access_and_security/floating_ips/workflows.py
index 58dd989..dbec798 100644
--- a/horizon/dashboards/nova/access_and_security/floating_ips/workflows.py
+++ b/horizon/dashboards/nova/access_and_security/floating_ips/workflows.py
@@ -23,13 +23,15 @@ from horizon import exceptions
from horizon import workflows
from horizon import forms
Hi Akihiro,
Just wanted to let you know that I tailored your patch for Folsom as follows and it fixed the problem.
diff --git a/horizon/ dashboards/ nova/access_ and_security/ floating_ ips/tables. py b/horizon/ dashboards/ nova/access_ and_security/ floating_ ips/tables. py dashboards/ nova/access_ and_security/ floating_ ips/tables. py dashboards/ nova/access_ and_security/ floating_ ips/tables. py
index e032e00..d12a38f 100644
--- a/horizon/
+++ b/horizon/
@@ -27,6 +27,7 @@ from horizon import exceptions
from horizon import messages
from horizon import tables
+from utils import get_int_or_uuid
LOG = logging. getLogger( __name_ _)
@@ -82,7 +83,8 @@ class DisassociateIP( tables. Action) :
def single(self, table, request, obj_id): object_ by_id(int( obj_id) ) object_ by_id(get_ int_or_ uuid(obj_ id))
api. server_ remove_ floating_ ip(request, fip.instance_id, fip.id)
LOG. info('Disassoci ating Floating IP "%s".' % obj_id)
messages. success( request, e(tables. DataTable) :
empty_ value=" -")
try:
- fip = table.get_
+ fip = table.get_
+
@@ -117,7 +119,7 @@ class FloatingIPsTabl
def sanitize_id(self, obj_id): or_uuid( obj_id)
- return int(obj_id)
+ return get_int_
def get_object_ display( self, datum): dashboards/ nova/access_ and_security/ floating_ ips/utils. py b/horizon/ dashboards/ nova/access_ and_security/ floating_ ips/utils. py dashboards/ nova/access_ and_security/ floating_ ips/utils. py www.apache. org/licenses/ LICENSE- 2.0 or_uuid( value): dashboards/ nova/access_ and_security/ floating_ ips/workflows. py b/horizon/ dashboards/ nova/access_ and_security/ floating_ ips/workflows. py dashboards/ nova/access_ and_security/ floating_ ips/workflows. py dashboards/ nova/access_ and_security/ floating_ ips/workflows. py
return datum.ip
diff --git a/horizon/
new file mode 100644
index 0000000..b61b8b3
--- /dev/null
+++ b/horizon/
@@ -0,0 +1,32 @@
+# vim: tabstop=4 shiftwidth=4 softtabstop=4
+
+# Copyright 2012 NEC Corporation All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+import uuid
+
+
+def get_int_
+ """Check if a value is valid as UUID or an integer.
+
+ This method is mainly used to convert floating IP id to the
+ appropriate type. For floating IP id, integer is used in Nova's
+ original implementation, but UUID is used in Quantum based one.
+ """
+ try:
+ uuid.UUID(value)
+ return value
+ except (ValueError, AttributeError):
+ return int(value)
+
diff --git a/horizon/
index 58dd989..dbec798 100644
--- a/horizon/
+++ b/horizon/
@@ -23,13 +23,15 @@ from horizon import exceptions
from horizon import workflows
from horizon import forms
+from utils import get_int_or_uuid
+
ALLOCATE_URL = "horizon: nova:access_ and_security: floating_ ips:allocate"
class AssociateIPActi on(workflows. Action) : pedChoiceField( label=_ ("IP Address"), get_int_ or_uuid,
empty_ value=None,
add_item_ link=ALLOCATE_ URL) ld(label= _("Instance" ))
ip_id = forms.DynamicTy
- coerce=int,
+ coerce=
instance_id = forms.ChoiceFie