From dada5174f2d364da8ec6ac1315055cbb3566f836 Mon Sep 17 00:00:00 2001 From: chenhb-zte Date: Sat, 9 Jul 2016 12:59:33 -0400 Subject: [PATCH] Use a shortcut to configure function Use a shortcut to configure function instead of a redefined new function. Change-Id: Ifa20565457b68f0ec2360185c51d7754cd4c241d --- rally/deployment/serverprovider/provider.py | 6 ++---- rally/task/runner.py | 5 +---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/rally/deployment/serverprovider/provider.py b/rally/deployment/serverprovider/provider.py index 9773ec20d2..2683abb8dd 100644 --- a/rally/deployment/serverprovider/provider.py +++ b/rally/deployment/serverprovider/provider.py @@ -22,6 +22,8 @@ from rally.common.plugin import plugin from rally.common import sshutils from rally.common import utils +configure = plugin.configure + class Server(utils.ImmutableMixin): """Represent information about created Server. @@ -91,10 +93,6 @@ class ResourceManager(object): self.deployment.delete_resource(resource_id) -def configure(name, namespace="default"): - return plugin.configure(name, namespace=namespace) - - @plugin.base() @six.add_metaclass(abc.ABCMeta) class ProviderFactory(plugin.Plugin): diff --git a/rally/task/runner.py b/rally/task/runner.py index 6ad555adcf..fc2bfecf13 100644 --- a/rally/task/runner.py +++ b/rally/task/runner.py @@ -32,6 +32,7 @@ from rally.task import utils LOG = logging.getLogger(__name__) +configure = plugin.configure def format_result_on_timeout(exc, timeout): @@ -97,10 +98,6 @@ def _log_worker_info(**info): LOG.debug("Starting a worker.\n\t%s" % info_message) -def configure(name, namespace="default"): - return plugin.configure(name=name, namespace=namespace) - - @plugin.base() class ScenarioRunner(plugin.Plugin): """Base class for all scenario runners.