X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=yardstick%2Fcmd%2Fcli.py;h=0bc7c1617763a5e4658eb73f9a0e659ebc30044f;hb=78939bfbd95b7047f00e234b03e478255ed6ece5;hp=d2c49e89be645142f2dc4f4502a11bf33a810102;hpb=79efa6e0d975dcd08aa5e29fc645d30601dfe927;p=yardstick.git diff --git a/yardstick/cmd/cli.py b/yardstick/cmd/cli.py index d2c49e89b..0bc7c1617 100644 --- a/yardstick/cmd/cli.py +++ b/yardstick/cmd/cli.py @@ -28,6 +28,8 @@ from yardstick.cmd.commands import testcase from yardstick.cmd.commands import plugin from yardstick.cmd.commands import env from yardstick.cmd.commands import report +from yardstick.common import import_tools + CONF = cfg.CONF cli_opts = [ @@ -53,7 +55,8 @@ def find_config_files(path_list): return None -class YardstickCLI(): # pragma: no cover +@import_tools.decorator_banned_modules +class YardstickCLI(object): # pragma: no cover """Command-line interface to yardstick""" # Command categories @@ -108,7 +111,7 @@ class YardstickCLI(): # pragma: no cover # register subcommands to parse additional command line arguments def parser(subparsers): - self._add_command_parsers(YardstickCLI.categories, subparsers) + self._add_command_parsers(self.categories, subparsers) category_opt = cfg.SubCommandOpt("category", title="Command categories", @@ -133,13 +136,13 @@ class YardstickCLI(): # pragma: no cover if CONF.debug: _LOG_STREAM_HDLR.setLevel(logging.DEBUG) - def _dispath_func_notask(self): + def _dispatch_func_notask(self): # dispatch to category parser func = CONF.category.func func(CONF.category) - def _dispath_func_task(self, task_id): + def _dispatch_func_task(self, task_id): # dispatch to category parser func = CONF.category.func @@ -159,7 +162,7 @@ class YardstickCLI(): # pragma: no cover self._handle_global_opts() - self._dispath_func_notask() + self._dispatch_func_notask() finally: self._clear_config_opts() @@ -172,6 +175,6 @@ class YardstickCLI(): # pragma: no cover self._handle_global_opts() - self._dispath_func_task(task_id) + self._dispatch_func_task(task_id) finally: self._clear_config_opts()