summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-03-11 01:19:35 +0000
committerGerrit Code Review <review@openstack.org>2016-03-11 01:19:35 +0000
commit99a56fdc803ddcb013452de71f348c15373c965a (patch)
tree94a4db75279bac6e1a62f50a8191d69936f994d1
parent781abf38d74be4f52d06ee3d051674582e554325 (diff)
parent0f4bc2b38e61bcd45d39f1893af1990605724832 (diff)
downloadhorizon-99a56fdc803ddcb013452de71f348c15373c965a.tar.gz
Merge "Refresh the networks on ajax update" into stable/liberty
-rw-r--r--openstack_dashboard/dashboards/admin/instances/tests.py1
-rw-r--r--openstack_dashboard/dashboards/project/instances/tables.py7
-rw-r--r--openstack_dashboard/dashboards/project/instances/tests.py4
3 files changed, 11 insertions, 1 deletions
diff --git a/openstack_dashboard/dashboards/admin/instances/tests.py b/openstack_dashboard/dashboards/admin/instances/tests.py
index 0937fe492..aa505cd52 100644
--- a/openstack_dashboard/dashboards/admin/instances/tests.py
+++ b/openstack_dashboard/dashboards/admin/instances/tests.py
@@ -148,6 +148,7 @@ class InstanceViewTest(test.BaseAdminViewTests):
@test.create_stubs({api.nova: ('server_get', 'flavor_get',
'extension_supported', ),
+ api.network: ('servers_update_addresses',),
api.keystone: ('tenant_get',)})
def test_ajax_loading_instances(self):
server = self.servers.first()
diff --git a/openstack_dashboard/dashboards/project/instances/tables.py b/openstack_dashboard/dashboards/project/instances/tables.py
index ba6857cd6..941d90669 100644
--- a/openstack_dashboard/dashboards/project/instances/tables.py
+++ b/openstack_dashboard/dashboards/project/instances/tables.py
@@ -755,6 +755,13 @@ class UpdateRow(tables.Row):
_('Unable to retrieve flavor information '
'for instance "%s".') % instance_id,
ignore=True)
+ try:
+ api.network.servers_update_addresses(request, [instance])
+ except Exception:
+ exceptions.handle(request,
+ _('Unable to retrieve Network information '
+ 'for instance "%s".') % instance_id,
+ ignore=True)
error = get_instance_error(instance)
if error:
messages.error(request, error)
diff --git a/openstack_dashboard/dashboards/project/instances/tests.py b/openstack_dashboard/dashboards/project/instances/tests.py
index cf828e518..da40bddfc 100644
--- a/openstack_dashboard/dashboards/project/instances/tests.py
+++ b/openstack_dashboard/dashboards/project/instances/tests.py
@@ -4473,6 +4473,7 @@ class InstanceAjaxTests(helpers.TestCase):
@helpers.create_stubs({api.nova: ("server_get",
"flavor_get",
"extension_supported"),
+ api.network: ('servers_update_addresses',),
api.neutron: ("is_extension_supported",)})
def test_row_update(self):
server = self.servers.first()
@@ -4506,7 +4507,8 @@ class InstanceAjaxTests(helpers.TestCase):
@helpers.create_stubs({api.nova: ("server_get",
"flavor_get",
"extension_supported"),
- api.neutron: ("is_extension_supported",)})
+ api.neutron: ("is_extension_supported",),
+ api.network: ('servers_update_addresses',)})
def test_row_update_instance_error(self):
server = self.servers.first()
instance_id = server.id