From ddf4dfa60a0d7d9295ef306c6f03dfd392505c64 Mon Sep 17 00:00:00 2001 From: Prasanna Santhanam Date: Tue, 29 Oct 2013 15:44:57 +0530 Subject: [PATCH] marvin: enable the nose-marvin plugin using the --with-marvin directive enable the marvin plugin when the --with-marvin directive is given to nose. The enableOpt value is set from the command line directive and self.enabled (True|False) determines whether marvin's tests will run. By default non-default plugins like marvin will be disabled" This fixes regression from 03830c5 Signed-off-by: Prasanna Santhanam --- tools/marvin/marvin/cloudstackTestClient.py | 3 --- tools/marvin/marvin/marvinPlugin.py | 12 ++++++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/tools/marvin/marvin/cloudstackTestClient.py b/tools/marvin/marvin/cloudstackTestClient.py index fbd4abab992..be93f3581cc 100644 --- a/tools/marvin/marvin/cloudstackTestClient.py +++ b/tools/marvin/marvin/cloudstackTestClient.py @@ -19,9 +19,6 @@ import cloudstackConnection import asyncJobMgr import dbConnection from cloudstackAPI import * -import random -import string -import hashlib ''' @Desc : CloudStackTestClient is encapsulated class for getting various \ diff --git a/tools/marvin/marvin/marvinPlugin.py b/tools/marvin/marvin/marvinPlugin.py index 2a749f09a9e..d5d02910643 100644 --- a/tools/marvin/marvin/marvinPlugin.py +++ b/tools/marvin/marvin/marvinPlugin.py @@ -33,6 +33,18 @@ class MarvinPlugin(Plugin): name = "marvin" def configure(self, options, config): + """enable the marvin plugin when the --with-marvin directive + is given to nose. The enableOpt value is set from the command line directive + and self.enabled (True|False) determines whether marvin's tests will run. + By default non-default plugins like marvin will be disabled + """ + if hasattr(options, self.enableOpt): + if not getattr(options, self.enableOpt): + self.enabled = False + return + else: + self.enabled = True + self.logformat = logging.Formatter("%(asctime)s - %(levelname)s - " + "%(name)s - %(message)s")