Gather logs only if fuel or apex installer 23/46423/1
authorPeriyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>
Wed, 18 Oct 2017 10:22:11 +0000 (12:22 +0200)
committerJose Lausuch <jalausuch@suse.com>
Mon, 30 Oct 2017 14:39:09 +0000 (14:39 +0000)
Change-Id: I11988ad86a916d1d7251aacf951c6362fda961ba
Signed-off-by: Periyasamy Palanisamy <periyasamy.palanisamy@ericsson.com>
(cherry picked from commit 308dc9989bce115b615fa13ff1dc44080e3a731e)

sdnvpn/lib/utils.py
sdnvpn/test/functest/run_sdnvpn_tests.py

index ad0714e..d968010 100644 (file)
@@ -213,7 +213,9 @@ def get_installerHandler():
     installer_ip = get_installer_ip()
 
     if installer_type not in ["fuel", "apex"]:
-        raise ValueError("%s is not supported" % installer_type)
+        logger.warn("installer type %s is neither fuel nor apex."
+                    "returning None for installer handler" % installer_type)
+        return None
     else:
         if installer_type in ["apex"]:
             developHandler = DeploymentFactory.get_handler(
index 140256d..6fa577f 100644 (file)
@@ -85,7 +85,13 @@ class SdnvpnFunctest(testcase.TestCase):
         self.stop_time = time.time()
 
         try:
-            gather_logs('overall')
+            installer_type = str(os.environ['INSTALLER_TYPE'].lower())
+            if installer_type in ["fuel", "apex"]:
+                gather_logs('overall')
+            else:
+                self.__logger.info("Skipping log gathering because installer"
+                                   "type %s is neither fuel nor apex" %
+                                   installer_type)
         except Exception as ex:
             self.__logger.error(('Something went wrong in the Log gathering.'
                                  'Ex: %s, Trace: %s')