Merge "Support single-AZ deployment"
This commit is contained in:
commit
ff1a0650da
@ -752,7 +752,7 @@ class NovaScenario(scenario.OpenStackScenario):
|
|||||||
new_host = random.choice(
|
new_host = random.choice(
|
||||||
[key for key, value in six.iteritems(az.hosts)
|
[key for key, value in six.iteritems(az.hosts)
|
||||||
if key != host and
|
if key != host and
|
||||||
value["nova-compute"]["available"] is True])
|
value.get("nova-compute", {}).get("available", False)])
|
||||||
return new_host
|
return new_host
|
||||||
except IndexError:
|
except IndexError:
|
||||||
raise exceptions.InvalidHostException(
|
raise exceptions.InvalidHostException(
|
||||||
|
@ -633,6 +633,8 @@ class NovaScenarioTestCase(test.ScenarioTestCase):
|
|||||||
def test__find_host_to_migrate(self):
|
def test__find_host_to_migrate(self):
|
||||||
fake_server = self.server
|
fake_server = self.server
|
||||||
fake_host = {"nova-compute": {"available": True}}
|
fake_host = {"nova-compute": {"available": True}}
|
||||||
|
fake_host_compute_off = {"nova-compute": {"available": False}}
|
||||||
|
fake_host_no_compute = {"nova-conductor": {"available": True}}
|
||||||
self.admin_clients("nova").servers.get.return_value = fake_server
|
self.admin_clients("nova").servers.get.return_value = fake_server
|
||||||
self.admin_clients("nova").availability_zones.list.return_value = [
|
self.admin_clients("nova").availability_zones.list.return_value = [
|
||||||
mock.MagicMock(zoneName="a",
|
mock.MagicMock(zoneName="a",
|
||||||
@ -640,7 +642,8 @@ class NovaScenarioTestCase(test.ScenarioTestCase):
|
|||||||
"a3": fake_host}),
|
"a3": fake_host}),
|
||||||
mock.MagicMock(zoneName="b",
|
mock.MagicMock(zoneName="b",
|
||||||
hosts={"b1": fake_host, "b2": fake_host,
|
hosts={"b1": fake_host, "b2": fake_host,
|
||||||
"b3": fake_host}),
|
"b3": fake_host, "b4": fake_host_compute_off,
|
||||||
|
"b5": fake_host_no_compute}),
|
||||||
mock.MagicMock(zoneName="c",
|
mock.MagicMock(zoneName="c",
|
||||||
hosts={"c1": fake_host,
|
hosts={"c1": fake_host,
|
||||||
"c2": fake_host, "c3": fake_host})
|
"c2": fake_host, "c3": fake_host})
|
||||||
|
Loading…
Reference in New Issue
Block a user