Skip to content

Commit

Permalink
Merge "Refresh the networks on ajax update"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Feb 10, 2016
2 parents 78cbb5e + b59ebcf commit 80bbc35
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions openstack_dashboard/dashboards/admin/instances/tests.py
Expand Up @@ -148,6 +148,7 @@ def test_index_server_list_exception(self):

@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()
Expand Down
7 changes: 7 additions & 0 deletions openstack_dashboard/dashboards/project/instances/tables.py
Expand Up @@ -779,6 +779,13 @@ def get_data(self, request, instance_id):
_('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)
Expand Down
4 changes: 3 additions & 1 deletion openstack_dashboard/dashboards/project/instances/tests.py
Expand Up @@ -4726,6 +4726,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()
Expand Down Expand Up @@ -4759,7 +4760,8 @@ def test_row_update(self):
@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
Expand Down

0 comments on commit 80bbc35

Please sign in to comment.