aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo¶rgen Karlsson <jorgen.w.karlsson@ericsson.com>2015-06-10 13:24:07 +0200
committerJo¶rgen Karlsson <jorgen.w.karlsson@ericsson.com>2015-06-11 15:00:54 +0200
commit95c9ca879e2ea2add0bb03c6e40a36494729d30d (patch)
treed3457145fc997a5f94ab7a9a9d982afc8866133a
parentadf4a310ea7138866e77b0759a07042daac0cca7 (diff)
fix deploy without placement groups
Change-Id: Ibc18a2652d3e8f4656fc58d7a5b45daeb36178d1 JIRA: YARDSTICK-30 Signed-off-by: Jo¶rgen Karlsson <jorgen.w.karlsson@ericsson.com>
-rw-r--r--yardstick/benchmark/context/model.py14
1 files changed, 13 insertions, 1 deletions
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" % (