Skip to content

Commit

Permalink
Merge "Fix nova-manage cell_v2 discover_hosts RequestContext"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Dec 18, 2016
2 parents ba3c17c + 93a9aaa commit 6d486ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nova/cmd/manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,7 @@ def discover_hosts(self, cell_uuid=None):
if cell_uuid:
cell_mappings = [objects.CellMapping.get_by_uuid(ctxt, cell_uuid)]
else:
cell_mappings = objects.CellMappingList.get_all(context)
cell_mappings = objects.CellMappingList.get_all(ctxt)

for cell_mapping in cell_mappings:
if cell_mapping.is_cell0():
Expand Down
2 changes: 2 additions & 0 deletions nova/tests/unit/test_nova_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -1390,6 +1390,8 @@ def test_discover_hosts_multiple_cells(self, mock_cell_mapping_get_by_uuid,
self.assertEqual(host_mapping_calls, mock_host_mapping.call_args_list)

mock_cell_mapping_get_by_uuid.assert_not_called()
mock_cell_mapping_get_all.assert_called_once_with(
test.MatchType(context.RequestContext))

def test_validate_transport_url_in_conf(self):
from_conf = 'fake://user:pass@host:port/'
Expand Down

0 comments on commit 6d486ff

Please sign in to comment.