Generate pod.yaml from current context
[yardstick.git] / yardstick / benchmark / contexts / heat.py
index a4bec63..2f3cc5a 100644 (file)
@@ -300,7 +300,7 @@ class HeatContext(Context):
 
     def deploy(self):
         """deploys template into a stack using cloud"""
-        print("Deploying context '%s'" % self.name)
+        LOG.info("Deploying context '%s' START", self.name)
 
         heat_template = HeatTemplate(self.name, self.template_file,
                                      self.heat_parameters)
@@ -330,7 +330,7 @@ class HeatContext(Context):
                 server.public_ip = \
                     self.stack.outputs[server.floating_ip["stack_name"]]
 
-        print("Context '%s' deployed" % self.name)
+        LOG.info("Deploying context '%s' DONE", self.name)
 
     def add_server_port(self, server):
         # use private ip from first port in first network
@@ -380,10 +380,10 @@ class HeatContext(Context):
     def undeploy(self):
         """undeploys stack from cloud"""
         if self.stack:
-            print("Undeploying context '%s'" % self.name)
+            LOG.info("Undeploying context '%s' START", self.name)
             self.stack.delete()
             self.stack = None
-            print("Context '%s' undeployed" % self.name)
+            LOG.info("Undeploying context '%s' DONE", self.name)
 
         if os.path.exists(self.key_filename):
             try:
@@ -442,6 +442,8 @@ class HeatContext(Context):
             "routing_table": self.generate_routing_table(server),
             # empty IPv6 routing table
             "nd_route_tbl": [],
+            # we want to save the contex name so we can generate pod.yaml
+            "name": server.name,
         }
         # Target server may only have private_ip
         if server.public_ip: