Merge "Delete functest.utils.functest_logger"
[functest.git] / functest / opnfv_tests / vnf / ims / orchestrator_cloudify.py
index f3838f8..4ceeb25 100644 (file)
@@ -11,6 +11,7 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 ########################################################################
 
+import logging
 import os
 import shutil
 import subprocess32 as subprocess
@@ -18,10 +19,8 @@ import yaml
 
 from git import Repo
 
-import functest.utils.functest_logger as ft_logger
 
-
-class Orchestrator:
+class Orchestrator(object):
 
     def __init__(self, testcase_dir, inputs={}):
         self.testcase_dir = testcase_dir
@@ -29,7 +28,7 @@ class Orchestrator:
         self.input_file = 'inputs.yaml'
         self.manager_blueprint = False
         self.config = inputs
-        self.logger = ft_logger.Logger("Orchestrator").getLogger()
+        self.logger = logging.getLogger(__name__)
         self.manager_up = False
 
     def set_credentials(self, username, password, tenant_name, auth_url):
@@ -114,6 +113,7 @@ class Orchestrator:
             cmd = "/bin/bash -c '" + script + "'"
             error = execute_command(cmd, self.logger)
             if error:
+                self.logger.error("Failed to deploy cloudify-manager")
                 return error
 
             self.logger.info("Cloudify-manager server is UP !")
@@ -171,6 +171,7 @@ class Orchestrator:
         cmd = "/bin/bash -c '" + script + "'"
         error = execute_command(cmd, self.logger, 2000)
         if error:
+            self.logger.error("Failed to deploy blueprint")
             return error
         self.logger.info("The deployment of {0} is ended".format(dep_name))
 
@@ -228,7 +229,4 @@ def execute_command(cmd, logger, timeout=1800):
             logger.error("Error when executing command %s" % cmd)
         f = open(output_file, 'r')
         lines = f.readlines()
-        result = lines[len(lines) - 3]
-        result += lines[len(lines) - 2]
-        result += lines[len(lines) - 1]
-        return result
+        return lines[-5:]