Rename namespace -> platform in context & validators plugins

- This change is backward compatible, it will add warning in
  case of using deprecated namespace arg

- Use "openstack" platform in openstack context plugins
  This is going to be needed after

Change-Id: I76194201aa1f39f3850809f32a0d6b0e55c8f7b1
This commit is contained in:
Boris Pavlovic 2017-07-21 12:47:25 -07:00
parent bf7f043c7e
commit cfa276a4b1
41 changed files with 55 additions and 52 deletions

View File

@ -43,7 +43,7 @@ class CheckOpenStackAPIVersionsValidator(validation.Validator):
@validation.add("check_api_versions")
@context.configure(name="api_versions", order=150)
@context.configure(name="api_versions", platform="openstack", order=150)
class OpenStackAPIVersions(context.Context):
"""Context for specifying OpenStack clients versions and service types.

View File

@ -28,7 +28,7 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="ceilometer", order=450)
@context.configure(name="ceilometer", platform="openstack", order=450)
class CeilometerSampleGenerator(context.Context):
"""Context for creating samples and collecting resources for benchmarks."""

View File

@ -27,7 +27,7 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", admin=True)
@context.configure(name="volume_types", order=410)
@context.configure(name="volume_types", platform="openstack", order=410)
class VolumeTypeGenerator(context.Context):
"""Context class for adding volumes types for benchmarks."""

View File

@ -25,7 +25,7 @@ from rally.task import context
LOG = logging.getLogger(__name__)
@context.configure(name="volumes", order=420)
@context.configure(name="volumes", platform="openstack", order=420)
class VolumeGenerator(context.Context):
"""Context class for adding volumes to each user for benchmarks."""

View File

@ -29,7 +29,8 @@ LOG = logging.getLogger(__name__)
@validation.add(name="check_cleanup_resources", admin_required=True)
# NOTE(amaretskiy): Set order to run this just before UserCleanup
@context.configure(name="admin_cleanup", order=(sys.maxsize - 1), hidden=True)
@context.configure(name="admin_cleanup", platform="openstack",
order=(sys.maxsize - 1), hidden=True)
class AdminCleanup(base.CleanupMixin, context.Context):
"""Context class for admin resources cleanup."""

View File

@ -29,7 +29,8 @@ LOG = logging.getLogger(__name__)
@validation.add(name="check_cleanup_resources", admin_required=False)
# NOTE(amaretskiy): Set maximum order to run this last
@context.configure(name="cleanup", order=sys.maxsize, hidden=True)
@context.configure(name="cleanup", platform="openstack", order=sys.maxsize,
hidden=True)
class UserCleanup(base.CleanupMixin, context.Context):
"""Context class for user resources cleanup."""

View File

@ -36,7 +36,7 @@ def get_data(filename_or_resource):
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="heat_dataplane", order=435)
@context.configure(name="heat_dataplane", platform="openstack", order=435)
class HeatDataplane(context.Context):
"""Context class for create stack by given template.

View File

@ -26,7 +26,7 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="zones", order=600)
@context.configure(name="zones", platform="openstack", order=600)
class ZoneGenerator(context.Context):
"""Context to add `zones_per_tenant` zones for each tenant."""

View File

@ -26,7 +26,7 @@ from rally.task import context
LOG = logging.getLogger(__name__)
@context.configure(name="ec2_servers", order=460)
@context.configure(name="ec2_servers", platform="openstack", order=460)
class EC2ServerGenerator(context.Context):
"""Context class for adding temporary servers for benchmarks.

View File

@ -36,7 +36,7 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="images", order=410)
@context.configure(name="images", platform="openstack", order=410)
class ImageGenerator(context.Context):
"""Context class for adding images to each user for benchmarks."""

View File

@ -26,7 +26,7 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="stacks", order=435)
@context.configure(name="stacks", platform="openstack", order=435)
class StackGenerator(context.Context):
"""Context class for create temporary stacks with resources.

View File

@ -32,7 +32,7 @@ CONF = cfg.CONF
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="roles", order=330)
@context.configure(name="roles", platform="openstack", order=330)
class RoleGenerator(context.Context):
"""Context class for assigning roles for users."""

View File

@ -47,7 +47,7 @@ USER_DOMAIN_DESCR = "ID of domain in which users will be created."
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="users", namespace="openstack", order=100)
@context.configure(name="users", platform="openstack", order=100)
class UserGenerator(context.Context):
"""Context class for generating temporary users/tenants for benchmarks."""

View File

@ -34,7 +34,7 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="ca_certs", order=490)
@context.configure(name="ca_certs", platform="openstack", order=490)
class CaCertGenerator(context.Context):
"""Context class for generating temporary ca cert for benchmarks."""

View File

@ -26,7 +26,7 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="cluster_templates", order=470)
@context.configure(name="cluster_templates", platform="openstack", order=470)
class ClusterTemplateGenerator(context.Context):
"""Context class for generating temporary cluster model for benchmarks."""

View File

@ -27,7 +27,7 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="clusters", order=480)
@context.configure(name="clusters", platform="openstack", order=480)
class ClusterGenerator(context.Context):
"""Context class for generating temporary cluster for benchmarks."""

View File

@ -32,7 +32,7 @@ CONTEXT_NAME = consts.SECURITY_SERVICES_CONTEXT_NAME
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name=CONTEXT_NAME, order=445)
@context.configure(name=CONTEXT_NAME, platform="openstack", order=445)
class SecurityServices(context.Context):
"""This context creates 'security services' for Manila project."""

View File

@ -62,7 +62,7 @@ users that does not satisfy criteria.
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name=CONTEXT_NAME, order=450)
@context.configure(name=CONTEXT_NAME, platform="openstack", order=450)
class ShareNetworks(context.Context):
"""This context creates share networks for Manila project."""
CONFIG_SCHEMA = {

View File

@ -32,7 +32,7 @@ CONTEXT_NAME = consts.SHARES_CONTEXT_NAME
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name=CONTEXT_NAME, order=455)
@context.configure(name=CONTEXT_NAME, platform="openstack", order=455)
class Shares(context.Context):
"""This context creates shares for Manila project."""

View File

@ -27,7 +27,7 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="monasca_metrics", order=510)
@context.configure(name="monasca_metrics", platform="openstack", order=510)
class MonascaMetricGenerator(context.Context):
"""Context for creating metrics for benchmarks."""

View File

@ -27,7 +27,7 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="murano_environments", order=402)
@context.configure(name="murano_environments", platform="openstack", order=402)
class EnvironmentGenerator(context.Context):
"""Context class for creating murano environments."""

View File

@ -33,7 +33,7 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="murano_packages", order=401)
@context.configure(name="murano_packages", platform="openstack", order=401)
class PackageGenerator(context.Context):
"""Context class for uploading applications for murano."""

View File

@ -84,7 +84,7 @@ def _prepare_open_secgroup(credential, secgroup_name):
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="allow_ssh", order=320)
@context.configure(name="allow_ssh", platform="openstack", order=320)
class AllowSSH(context.Context):
"""Sets up security groups for all users to access VM via SSH."""

View File

@ -27,7 +27,7 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="existing_network", order=349)
@context.configure(name="existing_network", platform="openstack", order=349)
class ExistingNetwork(context.Context):
"""This context supports using existing networks in Rally.

View File

@ -29,7 +29,7 @@ LOG = logging.getLogger(__name__)
# NOTE(andreykurilin): admin is used only by cleanup
@validation.add("required_platform", platform="openstack", admin=True,
users=True)
@context.configure(name="network", order=350)
@context.configure(name="network", platform="openstack", order=350)
class Network(context.Context):
"""Create networking resources.

View File

@ -28,7 +28,7 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", admin=True,
users=True)
@context.configure(name="router", order=351)
@context.configure(name="router", platform="openstack", order=351)
class Router(context.Context):
"""Create networking resources.

View File

@ -25,7 +25,7 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", admin=True,
users=True)
@context.configure(name="lbaas", order=360)
@context.configure(name="lbaas", platform="openstack", order=360)
class Lbaas(context.Context):
"""Creates a lb-pool for every subnet created in network context."""
CONFIG_SCHEMA = {

View File

@ -28,7 +28,7 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", admin=True)
@context.configure(name="flavors", order=340)
@context.configure(name="flavors", platform="openstack", order=340)
class FlavorsGenerator(context.Context):
"""Context creates a list of flavors."""

View File

@ -25,7 +25,7 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="keypair", order=310)
@context.configure(name="keypair", platform="openstack", order=310)
class Keypair(context.Context):
"""Create Nova KeyPair for each user."""

View File

@ -27,7 +27,7 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="servers", order=430)
@context.configure(name="servers", platform="openstack", order=430)
class ServerGenerator(context.Context):
"""Context class for adding temporary servers for benchmarks.

View File

@ -30,7 +30,7 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", admin=True)
@context.configure(name="quotas", order=300)
@context.configure(name="quotas", platform="openstack", order=300)
class Quotas(context.Context):
"""Context class for updating benchmarks' tenants quotas."""

View File

@ -32,7 +32,7 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="sahara_cluster", order=441)
@context.configure(name="sahara_cluster", platform="openstack", order=441)
class SaharaCluster(context.Context):
"""Context class for setting up the Cluster an EDP job."""

View File

@ -29,7 +29,7 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="sahara_image", order=440)
@context.configure(name="sahara_image", platform="openstack", order=440)
class SaharaImage(context.Context):
"""Context class for adding and tagging Sahara images."""

View File

@ -32,7 +32,8 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="sahara_input_data_sources", order=443)
@context.configure(name="sahara_input_data_sources", platform="openstack",
order=443)
class SaharaInputDataSources(context.Context):
"""Context class for setting up Input Data Sources for an EDP job."""

View File

@ -31,7 +31,7 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="sahara_job_binaries", order=442)
@context.configure(name="sahara_job_binaries", platform="openstack", order=442)
class SaharaJobBinaries(context.Context):
"""Context class for setting up Job Binaries for an EDP job."""

View File

@ -29,7 +29,8 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="sahara_output_data_sources", order=444)
@context.configure(name="sahara_output_data_sources", platform="openstack",
order=444)
class SaharaOutputDataSources(context.Context):
"""Context class for setting up Output Data Sources for an EDP job."""

View File

@ -22,7 +22,7 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="profiles", order=190)
@context.configure(name="profiles", platform="openstack", order=190)
class ProfilesGenerator(context.Context):
"""Context creates a temporary profile for Senlin test."""

View File

@ -25,7 +25,7 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="swift_objects", order=360)
@context.configure(name="swift_objects", platform="openstack", order=360)
class SwiftObjectGenerator(swift_utils.SwiftObjectMixin, context.Context):
"""Create containers and objects in each tenant."""
CONFIG_SCHEMA = {

View File

@ -23,7 +23,8 @@ import rally.task.context as context
@validation.add("required_platform", platform="openstack", users=True)
@context.configure(name="image_command_customizer", order=501)
@context.configure(name="image_command_customizer", platform="openstack",
order=501)
class ImageCommandCustomizerContext(custom_image.BaseCustomImageGenerator):
"""Context class for generating image customized by a command execution.

View File

@ -31,7 +31,7 @@ LOG = logging.getLogger(__name__)
@validation.add("required_platform", platform="openstack", admin=True)
@context.configure(name="audit_templates", order=550)
@context.configure(name="audit_templates", platform="openstack", order=550)
class AuditTemplateGenerator(context.Context):
"""Context class for adding temporary audit template for benchmarks."""

View File

@ -33,7 +33,7 @@ ValidationResult = validation.ValidationResult
@validation.add("required_platform", platform="openstack", users=True)
@validation.configure(name="image_exists", namespace="openstack")
@validation.configure(name="image_exists", platform="openstack")
class ImageExistsValidator(validation.Validator):
def __init__(self, param_name, nullable):
@ -81,7 +81,7 @@ class ImageExistsValidator(validation.Validator):
@validation.add("required_platform", platform="openstack", users=True)
@validation.configure(name="external_network_exists", namespace="openstack")
@validation.configure(name="external_network_exists", platform="openstack")
class ExternalNetworkExistsValidator(validation.Validator):
def __init__(self, param_name):
@ -118,8 +118,7 @@ class ExternalNetworkExistsValidator(validation.Validator):
@validation.add("required_platform", platform="openstack", users=True)
@validation.configure(name="required_neutron_extensions",
namespace="openstack")
@validation.configure(name="required_neutron_extensions", platform="openstack")
class RequiredNeutronExtensionsValidator(validation.Validator):
def __init__(self, extensions, *args):
@ -153,7 +152,7 @@ class RequiredNeutronExtensionsValidator(validation.Validator):
@validation.add("required_platform", platform="openstack", users=True)
@validation.configure(name="image_valid_on_flavor", namespace="openstack")
@validation.configure(name="image_valid_on_flavor", platform="openstack")
class ImageValidOnFlavorValidator(validation.Validator):
def __init__(self, flavor_param, image_param,
@ -292,7 +291,7 @@ class ImageValidOnFlavorValidator(validation.Validator):
@validation.add("required_platform", platform="openstack", users=True)
@validation.configure(name="required_clients", namespace="openstack")
@validation.configure(name="required_clients", platform="openstack")
class RequiredClientsValidator(validation.Validator):
def __init__(self, components, *args, **kwargs):
@ -346,7 +345,7 @@ class RequiredClientsValidator(validation.Validator):
@validation.add("required_platform", platform="openstack", users=True)
@validation.configure(name="required_services", namespace="openstack")
@validation.configure(name="required_services", platform="openstack")
class RequiredServicesValidator(validation.Validator):
def __init__(self, services, *args):
@ -396,7 +395,7 @@ class RequiredServicesValidator(validation.Validator):
@validation.add("required_platform", platform="openstack", users=True)
@validation.configure(name="validate_heat_template", namespace="openstack")
@validation.configure(name="validate_heat_template", platform="openstack")
class ValidateHeatTemplateValidator(validation.Validator):
def __init__(self, params, *args):
@ -446,7 +445,7 @@ class ValidateHeatTemplateValidator(validation.Validator):
@validation.add("required_platform", platform="openstack", admin=True)
@validation.configure(name="required_cinder_services", namespace="openstack")
@validation.configure(name="required_cinder_services", platform="openstack")
class RequiredCinderServicesValidator(validation.Validator):
def __init__(self, services):
@ -473,8 +472,7 @@ class RequiredCinderServicesValidator(validation.Validator):
@validation.add("required_platform", platform="openstack", users=True)
@validation.configure(name="required_api_versions",
namespace="openstack")
@validation.configure(name="required_api_versions", platform="openstack")
class RequiredAPIVersionsValidator(validation.Validator):
def __init__(self, component, versions):
@ -522,7 +520,7 @@ class RequiredAPIVersionsValidator(validation.Validator):
@validation.add("required_platform", platform="openstack", users=True)
@validation.configure(name="volume_type_exists", namespace="openstack")
@validation.configure(name="volume_type_exists", platform="openstack")
class VolumeTypeExistsValidator(validation.Validator):
def __init__(self, param_name, nullable=True):