Move rally.benchmark.context.base module
rally.benchmark.context.base -> rally.benchmark.context Change-Id: Id6a12d0a8b5e6ce82c5e05b066c00910ff720925
This commit is contained in:
parent
b0b2521cbd
commit
9dc1e7a3d0
@ -13,7 +13,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from rally.benchmark.context import base
|
||||
from rally.benchmark import context
|
||||
from rally.common.i18n import _
|
||||
from rally.common import log as logging
|
||||
from rally.common import utils
|
||||
@ -28,8 +28,8 @@ from rally.plugins.openstack.context.quotas import nova_quotas
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@base.context(name="quotas", order=300)
|
||||
class Quotas(base.Context):
|
||||
@context.context(name="quotas", order=300)
|
||||
class Quotas(context.Context):
|
||||
"""Context class for updating benchmarks' tenants quotas."""
|
||||
|
||||
CONFIG_SCHEMA = {
|
||||
@ -44,9 +44,9 @@ class Quotas(base.Context):
|
||||
}
|
||||
}
|
||||
|
||||
def __init__(self, context):
|
||||
super(Quotas, self).__init__(context)
|
||||
self.clients = osclients.Clients(context["admin"]["endpoint"])
|
||||
def __init__(self, ctx):
|
||||
super(Quotas, self).__init__(ctx)
|
||||
self.clients = osclients.Clients(self.context["admin"]["endpoint"])
|
||||
|
||||
self.manager = {
|
||||
"nova": nova_quotas.NovaQuotas(self.clients),
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from rally.benchmark.context import base
|
||||
from rally.benchmark import context
|
||||
from rally.benchmark import utils as bench_utils
|
||||
from rally.common.i18n import _
|
||||
from rally.common import log as logging
|
||||
@ -31,8 +31,8 @@ CONF = cfg.CONF
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@base.context(name="sahara_cluster", order=441)
|
||||
class SaharaCluster(base.Context):
|
||||
@context.context(name="sahara_cluster", order=441)
|
||||
class SaharaCluster(context.Context):
|
||||
"""Context class for setting up the Cluster an EDP job."""
|
||||
|
||||
CONFIG_SCHEMA = {
|
||||
@ -87,8 +87,8 @@ class SaharaCluster(base.Context):
|
||||
"flavor_id"]
|
||||
}
|
||||
|
||||
def __init__(self, context):
|
||||
super(SaharaCluster, self).__init__(context)
|
||||
def __init__(self, ctx):
|
||||
super(SaharaCluster, self).__init__(ctx)
|
||||
self.context["sahara_clusters"] = {}
|
||||
|
||||
@rutils.log_task_wrapper(LOG.info, _("Enter context: `Sahara Cluster`"))
|
||||
|
@ -12,7 +12,7 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from rally.benchmark.context import base
|
||||
from rally.benchmark import context
|
||||
from rally.common.i18n import _
|
||||
from rally.common import log as logging
|
||||
from rally.common import utils as rutils
|
||||
@ -26,8 +26,8 @@ from rally.plugins.openstack.scenarios.glance import utils as glance_utils
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@base.context(name="sahara_image", order=440)
|
||||
class SaharaImage(base.Context):
|
||||
@context.context(name="sahara_image", order=440)
|
||||
class SaharaImage(context.Context):
|
||||
"""Context class for adding and tagging Sahara images."""
|
||||
|
||||
CONFIG_SCHEMA = {
|
||||
@ -58,8 +58,8 @@ class SaharaImage(base.Context):
|
||||
"additionalProperties": False
|
||||
}
|
||||
|
||||
def __init__(self, context):
|
||||
super(SaharaImage, self).__init__(context)
|
||||
def __init__(self, ctx):
|
||||
super(SaharaImage, self).__init__(ctx)
|
||||
self.context["sahara_images"] = {}
|
||||
|
||||
def _create_image(self, hadoop_version, image_url, plugin_name, user,
|
||||
|
@ -17,7 +17,7 @@ import abc
|
||||
|
||||
import six
|
||||
|
||||
from rally.benchmark.context import base
|
||||
from rally.benchmark import context
|
||||
from rally.benchmark import types
|
||||
from rally.common import broker
|
||||
from rally.common.i18n import _
|
||||
@ -32,8 +32,8 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@six.add_metaclass(abc.ABCMeta)
|
||||
@base.context(name="custom_image", order=500, hidden=True)
|
||||
class BaseCustomImageGenerator(base.Context):
|
||||
@context.context(name="custom_image", order=500, hidden=True)
|
||||
class BaseCustomImageGenerator(context.Context):
|
||||
"""Base class for the contexts providing customized image with.
|
||||
|
||||
Every context class for the specific customization must implement
|
||||
|
@ -27,7 +27,7 @@ from novaclient import exceptions as nova_exceptions
|
||||
import six
|
||||
from swiftclient import exceptions as swift_exceptions
|
||||
|
||||
from rally.benchmark.context import base as base_ctx
|
||||
from rally.benchmark import context
|
||||
from rally.benchmark.scenarios import base
|
||||
from rally.common import utils as rally_utils
|
||||
from rally import consts
|
||||
@ -1498,8 +1498,8 @@ class FakeTimer(rally_utils.Timer):
|
||||
return 0
|
||||
|
||||
|
||||
@base_ctx.context("fake", order=1)
|
||||
class FakeContext(base_ctx.Context):
|
||||
@context.context("fake", order=1)
|
||||
class FakeContext(context.Context):
|
||||
|
||||
CONFIG_SCHEMA = {
|
||||
"type": "object",
|
||||
@ -1532,15 +1532,15 @@ class FakeUserContext(FakeContext):
|
||||
}
|
||||
tenants = {"uuid": {"name": "tenant"}}
|
||||
|
||||
def __init__(self, context):
|
||||
context.setdefault("task", mock.MagicMock())
|
||||
super(FakeUserContext, self).__init__(context)
|
||||
def __init__(self, ctx):
|
||||
ctx.setdefault("task", mock.MagicMock())
|
||||
super(FakeUserContext, self).__init__(ctx)
|
||||
|
||||
context.setdefault("admin", FakeUserContext.admin)
|
||||
context.setdefault("users", [FakeUserContext.user])
|
||||
context.setdefault("tenants", FakeUserContext.tenants)
|
||||
context.setdefault("scenario_name",
|
||||
"NovaServers.boot_server_from_volume_and_delete")
|
||||
self.context.setdefault("admin", FakeUserContext.admin)
|
||||
self.context.setdefault("users", [FakeUserContext.user])
|
||||
self.context.setdefault("tenants", FakeUserContext.tenants)
|
||||
self.context.setdefault(
|
||||
"scenario_name", "NovaServers.boot_server_from_volume_and_delete")
|
||||
|
||||
|
||||
class FakeDeployment(dict):
|
||||
|
Loading…
x
Reference in New Issue
Block a user