aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Feldt <hans.feldt@ericsson.com>2015-06-29 15:39:34 +0200
committerHans Feldt <hans.feldt@ericsson.com>2015-07-01 12:03:38 +0000
commitda2d2731a79da35b07a4ef0d4b6f8a426f853b41 (patch)
treebe7e071cc3e13c657a0f9de35dbb9300b3bf9a3a
parenta56e63d45362104919c9de89fb8b6da0c89e4a3b (diff)
Rename server resources aligning with task file
In the task file we have cross referencing between servers (VMs). This is done with DNS style naming. However servers created in the cloud does not get the same type of name. This patch aligns the cloud resource name with the one in the task file. This prepares for running external scripts that takes server names as input (see YARDSTICK-46) The "instances" support in model.Server is not really working and should be removed or fixed. No sample task file is using this feature for now. Change-Id: If2f752a82d224f07e4b5ee2361c1ff2454f39462 JIRA: - Signed-off-by: Hans Feldt <hans.feldt@ericsson.com>
-rw-r--r--yardstick/benchmark/context/model.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/yardstick/benchmark/context/model.py b/yardstick/benchmark/context/model.py
index 08778598d..6e754d421 100644
--- a/yardstick/benchmark/context/model.py
+++ b/yardstick/benchmark/context/model.py
@@ -119,7 +119,7 @@ class Server(Object):
def __init__(self, name, context, attrs):
super(Server, self).__init__(name, context)
- self.stack_name = context.name + "-" + self.name
+ self.stack_name = self.name + "." + context.name
self.keypair_name = context.keypair_name
self.secgroup_name = context.secgroup_name
self.context = context
@@ -211,12 +211,13 @@ class Server(Object):
def add_to_template(self, template, networks, scheduler_hints=None):
'''adds to the template one or more servers (instances)'''
if self.instances == 1:
- server_name = "%s-%s" % (template.name, self.name)
+ server_name = self.stack_name
self._add_instance(template, server_name, networks,
scheduler_hints=scheduler_hints)
else:
+ # TODO(hafe) fix or remove, no test/sample for this
for i in range(self.instances):
- server_name = "%s-%s-%d" % (template.name, self.name, i)
+ server_name = "%s-%d" % (self.stack_name, i)
self._add_instance(template, server_name, networks,
scheduler_hints=scheduler_hints)