From 95c9ca879e2ea2add0bb03c6e40a36494729d30d Mon Sep 17 00:00:00 2001 From: Jo¶rgen Karlsson Date: Wed, 10 Jun 2015 13:24:07 +0200 Subject: fix deploy without placement groups MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ibc18a2652d3e8f4656fc58d7a5b45daeb36178d1 JIRA: YARDSTICK-30 Signed-off-by: Jo¶rgen Karlsson --- yardstick/benchmark/context/model.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/yardstick/benchmark/context/model.py b/yardstick/benchmark/context/model.py index afb2d56dd..87bb01d3f 100644 --- a/yardstick/benchmark/context/model.py +++ b/yardstick/benchmark/context/model.py @@ -324,6 +324,11 @@ class Context(object): list_of_servers = sorted(self.servers, key=lambda s: len(s.placement_groups)) + # + # add servers with scheduler hints derived from placement groups + # + + # create list of servers with availability policy availability_servers = [] for server in list_of_servers: for pg in server.placement_groups: @@ -331,7 +336,7 @@ class Context(object): availability_servers.append(server) break - # add servers with scheduler hints derived from placement groups + # add servers with availability policy added_servers = [] for server in availability_servers: scheduler_hints = {} @@ -340,6 +345,7 @@ class Context(object): server.add_to_template(template, self.networks, scheduler_hints) added_servers.append(server.stack_name) + # create list of servers with affinity policy affinity_servers = [] for server in list_of_servers: for pg in server.placement_groups: @@ -347,6 +353,7 @@ class Context(object): affinity_servers.append(server) break + # add servers with affinity policy for server in affinity_servers: if server.stack_name in added_servers: continue @@ -356,6 +363,11 @@ class Context(object): server.add_to_template(template, self.networks, scheduler_hints) added_servers.append(server.stack_name) + # add remaining servers with no placement group configured + for server in list_of_servers: + if len(server.placement_groups) == 0: + server.add_to_template(template, self.networks, {}) + def deploy(self): '''deploys template into a stack using cloud''' print "Deploying context as stack '%s' using auth_url %s" % ( -- cgit 1.2.3-korg