summaryrefslogtreecommitdiff
path: root/openstack_dashboard/dashboards/project/instances/views.py
diff options
context:
space:
mode:
authorAkihiro Motoki <amotoki@gmail.com>2017-10-30 18:09:44 +0000
committerAkihiro Motoki <amotoki@gmail.com>2018-04-08 07:29:54 +0900
commitdd0eba2128a892bddef563b09e4a28122c50f458 (patch)
tree71707774a28128b53e5b7a3e125e8f618423d7dd /openstack_dashboard/dashboards/project/instances/views.py
parent7c09346e08251a8c5a5f8ae4311b132405d7e1c9 (diff)
downloadhorizon-dd0eba2128a892bddef563b09e4a28122c50f458.tar.gz
Support simple FIP disassociation (with FIP release)
We previously supported so-called "Simple FIP disassociation" which allows users to disassociate and release a FIP in a single action. We no longer support nova-network based features, but I believe it is worth implemented even in a neutron-only era. This patch introduces a checkbox "Release floating IP" to support this with neutron. At the same time, this patch also fixes a bug that the existing FIP disassociation action disassociates and releases a first FIP of a requested server. Even though it is a rare case where a single server has multiple FIPs, this is a bug. After this patch, FIPs associated with the requested server are listed in the form and a user can select an FIP to be disassociated. This patch drops a setting parameter 'simple_ip_management' without deprecation notice. This is actually no side effect because this setting just toggled the FIP disassociate action in the instance table and it provides nothing more than that. We can do the same thing by the policy file. Change-Id: Ie8053bdd3a3e4c7897c7c906788d40c2a1d3f708 Closes-Bug: #1226003
Diffstat (limited to 'openstack_dashboard/dashboards/project/instances/views.py')
-rw-r--r--openstack_dashboard/dashboards/project/instances/views.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/openstack_dashboard/dashboards/project/instances/views.py b/openstack_dashboard/dashboards/project/instances/views.py
index cc0ff2046..4c37343f6 100644
--- a/openstack_dashboard/dashboards/project/instances/views.py
+++ b/openstack_dashboard/dashboards/project/instances/views.py
@@ -388,6 +388,22 @@ class DecryptPasswordView(forms.ModalFormView):
'keypair_name': self.kwargs['keypair_name']}
+class DisassociateView(forms.ModalFormView):
+ form_class = project_forms.Disassociate
+ template_name = 'project/instances/disassociate.html'
+ success_url = reverse_lazy('horizon:project:instances:index')
+ page_title = _("Disassociate floating IP")
+ submit_label = _("Disassocaite")
+
+ def get_context_data(self, **kwargs):
+ context = super(DisassociateView, self).get_context_data(**kwargs)
+ context['instance_id'] = self.kwargs['instance_id']
+ return context
+
+ def get_initial(self):
+ return {'instance_id': self.kwargs['instance_id']}
+
+
class DetailView(tabs.TabView):
tab_group_class = project_tabs.InstanceDetailTabs
template_name = 'horizon/common/_detail.html'