diff --git a/rally/plugins/openstack/context/ceilometer/samples.py b/rally/plugins/openstack/context/ceilometer/samples.py index 869a6750..8f76f1dc 100644 --- a/rally/plugins/openstack/context/ceilometer/samples.py +++ b/rally/plugins/openstack/context/ceilometer/samples.py @@ -23,7 +23,7 @@ from rally.task import context LOG = logging.getLogger(__name__) -@context.context(name="ceilometer", order=450) +@context.configure(name="ceilometer", order=450) class CeilometerSampleGenerator(context.Context): """Context for creating samples and collecting resources for benchmarks.""" diff --git a/rally/plugins/openstack/context/cinder/volumes.py b/rally/plugins/openstack/context/cinder/volumes.py index 723afd7b..a15847ab 100644 --- a/rally/plugins/openstack/context/cinder/volumes.py +++ b/rally/plugins/openstack/context/cinder/volumes.py @@ -25,7 +25,7 @@ from rally.task.scenarios import base as scenario_base LOG = logging.getLogger(__name__) -@context.context(name="volumes", order=420) +@context.configure(name="volumes", order=420) class VolumeGenerator(context.Context): """Context class for adding volumes to each user for benchmarks.""" diff --git a/rally/plugins/openstack/context/glance/images.py b/rally/plugins/openstack/context/glance/images.py index add8eff2..c61906ed 100644 --- a/rally/plugins/openstack/context/glance/images.py +++ b/rally/plugins/openstack/context/glance/images.py @@ -24,7 +24,7 @@ from rally.task import context LOG = logging.getLogger(__name__) -@context.context(name="images", order=410) +@context.configure(name="images", order=410) class ImageGenerator(context.Context): """Context class for adding images to each user for benchmarks.""" diff --git a/rally/plugins/openstack/context/heat/stacks.py b/rally/plugins/openstack/context/heat/stacks.py index 64cabe01..8efd7e35 100644 --- a/rally/plugins/openstack/context/heat/stacks.py +++ b/rally/plugins/openstack/context/heat/stacks.py @@ -24,7 +24,7 @@ from rally.task import context LOG = logging.getLogger(__name__) -@context.context(name="stacks", order=435) +@context.configure(name="stacks", order=435) class StackGenerator(context.Context): """Context class for create temporary stacks with resources. diff --git a/rally/plugins/openstack/context/keystone/roles.py b/rally/plugins/openstack/context/keystone/roles.py index d4ea7715..c255fc02 100644 --- a/rally/plugins/openstack/context/keystone/roles.py +++ b/rally/plugins/openstack/context/keystone/roles.py @@ -25,7 +25,7 @@ from rally.task import context LOG = logging.getLogger(__name__) -@context.context(name="roles", order=330) +@context.configure(name="roles", order=330) class RoleGenerator(context.Context): """Context class for adding temporary roles for benchmarks.""" diff --git a/rally/plugins/openstack/context/keystone/users.py b/rally/plugins/openstack/context/keystone/users.py index 3e419ae9..f32d7035 100644 --- a/rally/plugins/openstack/context/keystone/users.py +++ b/rally/plugins/openstack/context/keystone/users.py @@ -52,7 +52,7 @@ CONF.register_opts(USER_CONTEXT_OPTS, title="benchmark context options")) -@context.context(name="users", order=100) +@context.configure(name="users", order=100) class UserGenerator(context.Context): """Context class for generating temporary users/tenants for benchmarks.""" diff --git a/rally/plugins/openstack/context/murano/murano_packages.py b/rally/plugins/openstack/context/murano/murano_packages.py index 19fe112c..018dcef1 100644 --- a/rally/plugins/openstack/context/murano/murano_packages.py +++ b/rally/plugins/openstack/context/murano/murano_packages.py @@ -28,7 +28,7 @@ from rally.task import context LOG = logging.getLogger(__name__) -@context.context(name="murano_packages", order=401) +@context.configure(name="murano_packages", order=401) class PackageGenerator(context.Context): """Context class for uploading applications for murano.""" diff --git a/rally/plugins/openstack/context/network/allow_ssh.py b/rally/plugins/openstack/context/network/allow_ssh.py index f9514dc0..ae6cf12a 100644 --- a/rally/plugins/openstack/context/network/allow_ssh.py +++ b/rally/plugins/openstack/context/network/allow_ssh.py @@ -85,7 +85,7 @@ def _prepare_open_secgroup(endpoint, secgroup_name): return rally_open.to_dict() -@context.context(name="allow_ssh", order=320) +@context.configure(name="allow_ssh", order=320) class AllowSSH(context.Context): @utils.log_task_wrapper(LOG.info, _("Enter context: `allow_ssh`")) diff --git a/rally/plugins/openstack/context/network/networks.py b/rally/plugins/openstack/context/network/networks.py index d3261f0b..110b8cda 100644 --- a/rally/plugins/openstack/context/network/networks.py +++ b/rally/plugins/openstack/context/network/networks.py @@ -27,7 +27,7 @@ from rally.task import context LOG = logging.getLogger(__name__) -@context.context(name="network", order=350) +@context.configure(name="network", order=350) class Network(context.Context): CONFIG_SCHEMA = { "type": "object", diff --git a/rally/plugins/openstack/context/neutron/lbaas.py b/rally/plugins/openstack/context/neutron/lbaas.py index 192170a0..6d15fb71 100644 --- a/rally/plugins/openstack/context/neutron/lbaas.py +++ b/rally/plugins/openstack/context/neutron/lbaas.py @@ -24,7 +24,7 @@ from rally.task import context LOG = logging.getLogger(__name__) -@context.context(name="lbaas", order=360) +@context.configure(name="lbaas", order=360) class Lbaas(context.Context): CONFIG_SCHEMA = { "type": "object", diff --git a/rally/plugins/openstack/context/nova/flavors.py b/rally/plugins/openstack/context/nova/flavors.py index 53b653a5..b35d89a5 100644 --- a/rally/plugins/openstack/context/nova/flavors.py +++ b/rally/plugins/openstack/context/nova/flavors.py @@ -25,7 +25,7 @@ from rally.task import context LOG = logging.getLogger(__name__) -@context.context(name="flavors", order=340) +@context.configure(name="flavors", order=340) class FlavorsGenerator(context.Context): """Context creates a list of flavors.""" diff --git a/rally/plugins/openstack/context/nova/keypairs.py b/rally/plugins/openstack/context/nova/keypairs.py index 72053fbf..f713c752 100644 --- a/rally/plugins/openstack/context/nova/keypairs.py +++ b/rally/plugins/openstack/context/nova/keypairs.py @@ -26,7 +26,7 @@ from rally.task import context LOG = logging.getLogger(__name__) -@context.context(name="keypair", order=310) +@context.configure(name="keypair", order=310) class Keypair(context.Context): KEYPAIR_NAME = "rally_ssh_key" diff --git a/rally/plugins/openstack/context/nova/servers.py b/rally/plugins/openstack/context/nova/servers.py index c84b0db5..6bf95d8c 100644 --- a/rally/plugins/openstack/context/nova/servers.py +++ b/rally/plugins/openstack/context/nova/servers.py @@ -26,7 +26,7 @@ from rally.task import types LOG = logging.getLogger(__name__) -@context.context(name="servers", order=430) +@context.configure(name="servers", order=430) class ServerGenerator(context.Context): """Context class for adding temporary servers for benchmarks. diff --git a/rally/plugins/openstack/context/quotas/quotas.py b/rally/plugins/openstack/context/quotas/quotas.py index 89d86b61..b5313cf2 100644 --- a/rally/plugins/openstack/context/quotas/quotas.py +++ b/rally/plugins/openstack/context/quotas/quotas.py @@ -29,7 +29,7 @@ from rally.task import context LOG = logging.getLogger(__name__) -@context.context(name="quotas", order=300) +@context.configure(name="quotas", order=300) class Quotas(context.Context): """Context class for updating benchmarks' tenants quotas.""" diff --git a/rally/plugins/openstack/context/sahara/sahara_cluster.py b/rally/plugins/openstack/context/sahara/sahara_cluster.py index 221a58a5..8767afe1 100644 --- a/rally/plugins/openstack/context/sahara/sahara_cluster.py +++ b/rally/plugins/openstack/context/sahara/sahara_cluster.py @@ -30,7 +30,7 @@ CONF = cfg.CONF LOG = logging.getLogger(__name__) -@context.context(name="sahara_cluster", order=441) +@context.configure(name="sahara_cluster", order=441) class SaharaCluster(context.Context): """Context class for setting up the Cluster an EDP job.""" diff --git a/rally/plugins/openstack/context/sahara/sahara_image.py b/rally/plugins/openstack/context/sahara/sahara_image.py index e6e4a3cd..e8b57cc3 100644 --- a/rally/plugins/openstack/context/sahara/sahara_image.py +++ b/rally/plugins/openstack/context/sahara/sahara_image.py @@ -26,7 +26,7 @@ from rally.task import context LOG = logging.getLogger(__name__) -@context.context(name="sahara_image", order=440) +@context.configure(name="sahara_image", order=440) class SaharaImage(context.Context): """Context class for adding and tagging Sahara images.""" diff --git a/rally/plugins/openstack/context/vm/custom_image.py b/rally/plugins/openstack/context/vm/custom_image.py index b16cb3fd..02183705 100644 --- a/rally/plugins/openstack/context/vm/custom_image.py +++ b/rally/plugins/openstack/context/vm/custom_image.py @@ -32,7 +32,7 @@ LOG = logging.getLogger(__name__) @six.add_metaclass(abc.ABCMeta) -@context.context(name="custom_image", order=500, hidden=True) +@context.configure(name="custom_image", order=500, hidden=True) class BaseCustomImageGenerator(context.Context): """Base class for the contexts providing customized image with. diff --git a/rally/plugins/openstack/context/vm/image_command_customizer.py b/rally/plugins/openstack/context/vm/image_command_customizer.py index 2db387e3..e927cd8f 100644 --- a/rally/plugins/openstack/context/vm/image_command_customizer.py +++ b/rally/plugins/openstack/context/vm/image_command_customizer.py @@ -21,7 +21,7 @@ from rally.plugins.openstack.scenarios.vm import utils as vm_utils import rally.task.context as context -@context.context(name="image_command_customizer", order=501) +@context.configure(name="image_command_customizer", order=501) class ImageCommandCustomizerContext(custom_image.BaseCustomImageGenerator): """Context class for generating image customized by a command execution. diff --git a/tests/unit/fakes.py b/tests/unit/fakes.py index c0115857..d58e09e4 100644 --- a/tests/unit/fakes.py +++ b/tests/unit/fakes.py @@ -1494,7 +1494,7 @@ class FakeTimer(rally_utils.Timer): return 0 -@context.context(name="fake", order=1) +@context.configure(name="fake", order=1) class FakeContext(context.Context): CONFIG_SCHEMA = { @@ -1515,12 +1515,12 @@ class FakeContext(context.Context): pass -@context.context(name="fake_hidden_context", order=1, hidden=True) +@context.configure(name="fake_hidden_context", order=1, hidden=True) class FakeHiddenContext(FakeContext): pass -@context.context(name="fake_user_context", order=1) +@context.configure(name="fake_user_context", order=1) class FakeUserContext(FakeContext): admin = { diff --git a/tests/unit/plugins/openstack/context/vm/test_custom_image.py b/tests/unit/plugins/openstack/context/vm/test_custom_image.py index 8ecb872b..42f6f205 100644 --- a/tests/unit/plugins/openstack/context/vm/test_custom_image.py +++ b/tests/unit/plugins/openstack/context/vm/test_custom_image.py @@ -25,7 +25,7 @@ from tests.unit import test BASE = "rally.plugins.openstack.context.vm.custom_image" -@context.context(name="test_custom_image", order=500) +@context.configure(name="test_custom_image", order=500) class TestImageGenerator(custom_image.BaseCustomImageGenerator): def _customize_image(self, *args): pass