Merge "Improve context manager setup()/cleanup() logging"
This commit is contained in:
commit
bed0fda0f9
@ -120,7 +120,6 @@ class CeilometerSampleGenerator(context.Context):
|
|||||||
|
|
||||||
return samples
|
return samples
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `Ceilometer`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
new_sample = {
|
new_sample = {
|
||||||
"counter_name": self.config["counter_name"],
|
"counter_name": self.config["counter_name"],
|
||||||
@ -175,7 +174,6 @@ class CeilometerSampleGenerator(context.Context):
|
|||||||
ctx_name=self.get_name(),
|
ctx_name=self.get_name(),
|
||||||
msg="Ceilometer Resource %s is not found" % resource_id)
|
msg="Ceilometer Resource %s is not found" % resource_id)
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `Ceilometer`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
# We don't have API for removal of samples and resources
|
# We don't have API for removal of samples and resources
|
||||||
pass
|
pass
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
from rally.common import logging
|
||||||
from rally.common import utils
|
from rally.common import utils
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
@ -37,7 +36,6 @@ class VolumeTypeGenerator(context.Context):
|
|||||||
"items": {"type": "string"}
|
"items": {"type": "string"}
|
||||||
}
|
}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `volume_types`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
admin_clients = osclients.Clients(
|
admin_clients = osclients.Clients(
|
||||||
self.context.get("admin", {}).get("credential"),
|
self.context.get("admin", {}).get("credential"),
|
||||||
@ -51,7 +49,6 @@ class VolumeTypeGenerator(context.Context):
|
|||||||
self.context["volume_types"].append({"id": vtype.id,
|
self.context["volume_types"].append({"id": vtype.id,
|
||||||
"name": vtype_name})
|
"name": vtype_name})
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `volume_types`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
mather = utils.make_name_matcher(*self.config)
|
mather = utils.make_name_matcher(*self.config)
|
||||||
resource_manager.cleanup(
|
resource_manager.cleanup(
|
||||||
|
@ -12,8 +12,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import utils as rutils
|
from rally.common import utils as rutils
|
||||||
from rally import consts
|
from rally import consts
|
||||||
from rally import osclients
|
from rally import osclients
|
||||||
@ -22,9 +20,6 @@ from rally.plugins.openstack.services.storage import block
|
|||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
@context.configure(name="volumes", platform="openstack", order=420)
|
@context.configure(name="volumes", platform="openstack", order=420)
|
||||||
class VolumeGenerator(context.Context):
|
class VolumeGenerator(context.Context):
|
||||||
"""Creates volumes for each tenant."""
|
"""Creates volumes for each tenant."""
|
||||||
@ -58,7 +53,6 @@ class VolumeGenerator(context.Context):
|
|||||||
"volumes_per_tenant": 1
|
"volumes_per_tenant": 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `Volumes`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
size = self.config["size"]
|
size = self.config["size"]
|
||||||
volume_type = self.config.get("type", None)
|
volume_type = self.config.get("type", None)
|
||||||
@ -78,7 +72,6 @@ class VolumeGenerator(context.Context):
|
|||||||
self.context["tenants"][tenant_id]["volumes"].append(
|
self.context["tenants"][tenant_id]["volumes"].append(
|
||||||
vol._as_dict())
|
vol._as_dict())
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `Volumes`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
resource_manager.cleanup(
|
resource_manager.cleanup(
|
||||||
names=["cinder.volumes"],
|
names=["cinder.volumes"],
|
||||||
|
@ -15,8 +15,6 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
from rally.plugins.openstack.cleanup import manager
|
from rally.plugins.openstack.cleanup import manager
|
||||||
from rally.plugins.openstack.context.cleanup import base
|
from rally.plugins.openstack.context.cleanup import base
|
||||||
@ -24,9 +22,6 @@ from rally.plugins.openstack import scenario
|
|||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add(name="check_cleanup_resources", admin_required=True)
|
@validation.add(name="check_cleanup_resources", admin_required=True)
|
||||||
# NOTE(amaretskiy): Set order to run this just before UserCleanup
|
# NOTE(amaretskiy): Set order to run this just before UserCleanup
|
||||||
@context.configure(name="admin_cleanup", platform="openstack",
|
@context.configure(name="admin_cleanup", platform="openstack",
|
||||||
@ -34,7 +29,6 @@ LOG = logging.getLogger(__name__)
|
|||||||
class AdminCleanup(base.CleanupMixin, context.Context):
|
class AdminCleanup(base.CleanupMixin, context.Context):
|
||||||
"""Context class for admin resources cleanup."""
|
"""Context class for admin resources cleanup."""
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("admin resources cleanup"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
manager.cleanup(
|
manager.cleanup(
|
||||||
names=self.config,
|
names=self.config,
|
||||||
|
@ -15,8 +15,6 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
from rally.plugins.openstack.cleanup import manager
|
from rally.plugins.openstack.cleanup import manager
|
||||||
from rally.plugins.openstack.context.cleanup import base
|
from rally.plugins.openstack.context.cleanup import base
|
||||||
@ -24,9 +22,6 @@ from rally.plugins.openstack import scenario
|
|||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add(name="check_cleanup_resources", admin_required=False)
|
@validation.add(name="check_cleanup_resources", admin_required=False)
|
||||||
# NOTE(amaretskiy): Set maximum order to run this last
|
# NOTE(amaretskiy): Set maximum order to run this last
|
||||||
@context.configure(name="cleanup", platform="openstack", order=sys.maxsize,
|
@context.configure(name="cleanup", platform="openstack", order=sys.maxsize,
|
||||||
@ -34,7 +29,6 @@ LOG = logging.getLogger(__name__)
|
|||||||
class UserCleanup(base.CleanupMixin, context.Context):
|
class UserCleanup(base.CleanupMixin, context.Context):
|
||||||
"""Context class for user resources cleanup."""
|
"""Context class for user resources cleanup."""
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("user resources cleanup"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
manager.cleanup(
|
manager.cleanup(
|
||||||
names=self.config,
|
names=self.config,
|
||||||
|
@ -15,8 +15,6 @@
|
|||||||
|
|
||||||
import pkgutil
|
import pkgutil
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import utils as rutils
|
from rally.common import utils as rutils
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
from rally import consts
|
from rally import consts
|
||||||
@ -26,8 +24,6 @@ from rally.plugins.openstack.cleanup import manager as resource_manager
|
|||||||
from rally.plugins.openstack.scenarios.heat import utils as heat_utils
|
from rally.plugins.openstack.scenarios.heat import utils as heat_utils
|
||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
def get_data(filename_or_resource):
|
def get_data(filename_or_resource):
|
||||||
if isinstance(filename_or_resource, list):
|
if isinstance(filename_or_resource, list):
|
||||||
@ -113,7 +109,6 @@ class HeatDataplane(context.Context):
|
|||||||
networks = nc.list_networks(**{"router:external": True})["networks"]
|
networks = nc.list_networks(**{"router:external": True})["networks"]
|
||||||
return networks[0]["id"]
|
return networks[0]["id"]
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `HeatDataplane`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
template = get_data(self.config["template"])
|
template = get_data(self.config["template"])
|
||||||
files = {}
|
files = {}
|
||||||
@ -146,7 +141,6 @@ class HeatDataplane(context.Context):
|
|||||||
tenant_data["stack_dataplane"].append([stack.id, template,
|
tenant_data["stack_dataplane"].append([stack.id, template,
|
||||||
files, parameters])
|
files, parameters])
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `HeatDataplane`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
resource_manager.cleanup(names=["heat.stacks"],
|
resource_manager.cleanup(names=["heat.stacks"],
|
||||||
users=self.context.get("users", []),
|
users=self.context.get("users", []),
|
||||||
|
@ -12,8 +12,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import utils as rutils
|
from rally.common import utils as rutils
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
from rally import consts
|
from rally import consts
|
||||||
@ -22,9 +20,6 @@ from rally.plugins.openstack.scenarios.designate import utils
|
|||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
@validation.add("required_platform", platform="openstack", users=True)
|
||||||
@context.configure(name="zones", platform="openstack", order=600)
|
@context.configure(name="zones", platform="openstack", order=600)
|
||||||
class ZoneGenerator(context.Context):
|
class ZoneGenerator(context.Context):
|
||||||
@ -46,7 +41,6 @@ class ZoneGenerator(context.Context):
|
|||||||
"zones_per_tenant": 1
|
"zones_per_tenant": 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `Zones`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
for user, tenant_id in rutils.iterate_per_tenants(
|
for user, tenant_id in rutils.iterate_per_tenants(
|
||||||
self.context["users"]):
|
self.context["users"]):
|
||||||
@ -59,7 +53,6 @@ class ZoneGenerator(context.Context):
|
|||||||
zone = designate_util._create_zone()
|
zone = designate_util._create_zone()
|
||||||
self.context["tenants"][tenant_id]["zones"].append(zone)
|
self.context["tenants"][tenant_id]["zones"].append(zone)
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `Zones`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
resource_manager.cleanup(names=["designate.zones"],
|
resource_manager.cleanup(names=["designate.zones"],
|
||||||
users=self.context.get("users", []),
|
users=self.context.get("users", []),
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
from rally.common import logging
|
||||||
from rally.common import utils as rutils
|
from rally.common import utils as rutils
|
||||||
from rally import consts
|
from rally import consts
|
||||||
@ -59,7 +58,6 @@ class EC2ServerGenerator(context.Context):
|
|||||||
"additionalProperties": False
|
"additionalProperties": False
|
||||||
}
|
}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `EC2 Servers`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
image = self.config["image"]
|
image = self.config["image"]
|
||||||
flavor = self.config["flavor"]
|
flavor = self.config["flavor"]
|
||||||
@ -91,7 +89,6 @@ class EC2ServerGenerator(context.Context):
|
|||||||
|
|
||||||
self.context["tenants"][tenant_id]["ec2_servers"] = current_servers
|
self.context["tenants"][tenant_id]["ec2_servers"] = current_servers
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `EC2 Servers`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
resource_manager.cleanup(names=["ec2.servers"],
|
resource_manager.cleanup(names=["ec2.servers"],
|
||||||
users=self.context.get("users", []),
|
users=self.context.get("users", []),
|
||||||
|
@ -121,7 +121,6 @@ class ImageGenerator(context.Context):
|
|||||||
|
|
||||||
DEFAULT_CONFIG = {"images_per_tenant": 1}
|
DEFAULT_CONFIG = {"images_per_tenant": 1}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `Images`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
image_url = self.config.get("image_url")
|
image_url = self.config.get("image_url")
|
||||||
disk_format = self.config.get("disk_format")
|
disk_format = self.config.get("disk_format")
|
||||||
@ -190,7 +189,6 @@ class ImageGenerator(context.Context):
|
|||||||
|
|
||||||
self.context["tenants"][tenant_id]["images"] = current_images
|
self.context["tenants"][tenant_id]["images"] = current_images
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `Images`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
if self.context.get("admin", {}):
|
if self.context.get("admin", {}):
|
||||||
# NOTE(andreykurilin): Glance does not require the admin for
|
# NOTE(andreykurilin): Glance does not require the admin for
|
||||||
|
@ -13,8 +13,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import utils as rutils
|
from rally.common import utils as rutils
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
from rally import consts
|
from rally import consts
|
||||||
@ -22,8 +20,6 @@ from rally.plugins.openstack.cleanup import manager as resource_manager
|
|||||||
from rally.plugins.openstack.scenarios.heat import utils as heat_utils
|
from rally.plugins.openstack.scenarios.heat import utils as heat_utils
|
||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
@validation.add("required_platform", platform="openstack", users=True)
|
||||||
@context.configure(name="stacks", platform="openstack", order=435)
|
@context.configure(name="stacks", platform="openstack", order=435)
|
||||||
@ -72,7 +68,6 @@ class StackGenerator(context.Context):
|
|||||||
template["resources"]["TestResource%d" % i] = rand_string
|
template["resources"]["TestResource%d" % i] = rand_string
|
||||||
return template
|
return template
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `Stacks`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
template = self._prepare_stack_template(
|
template = self._prepare_stack_template(
|
||||||
self.config["resources_per_stack"])
|
self.config["resources_per_stack"])
|
||||||
@ -86,7 +81,6 @@ class StackGenerator(context.Context):
|
|||||||
stack = heat_scenario._create_stack(template)
|
stack = heat_scenario._create_stack(template)
|
||||||
self.context["tenants"][tenant_id]["stacks"].append(stack.id)
|
self.context["tenants"][tenant_id]["stacks"].append(stack.id)
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `Stacks`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
resource_manager.cleanup(names=["heat.stacks"],
|
resource_manager.cleanup(names=["heat.stacks"],
|
||||||
users=self.context.get("users", []),
|
users=self.context.get("users", []),
|
||||||
|
@ -75,7 +75,6 @@ class RoleGenerator(context.Context):
|
|||||||
project_id=project_id)
|
project_id=project_id)
|
||||||
return consume
|
return consume
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `roles`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
"""Add all roles to users."""
|
"""Add all roles to users."""
|
||||||
threads = self.workers
|
threads = self.workers
|
||||||
@ -97,7 +96,6 @@ class RoleGenerator(context.Context):
|
|||||||
broker.run(publish, self._get_consumer("add_role"), threads)
|
broker.run(publish, self._get_consumer("add_role"), threads)
|
||||||
self.context["roles"] = roles_dict
|
self.context["roles"] = roles_dict
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `roles`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
"""Remove all roles from users."""
|
"""Remove all roles from users."""
|
||||||
threads = self.workers
|
threads = self.workers
|
||||||
|
@ -304,7 +304,6 @@ class UserGenerator(context.Context):
|
|||||||
"tenant_id": tenant_id
|
"tenant_id": tenant_id
|
||||||
})
|
})
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `users`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
self.context["users"] = []
|
self.context["users"] = []
|
||||||
self.context["tenants"] = {}
|
self.context["tenants"] = {}
|
||||||
@ -315,7 +314,6 @@ class UserGenerator(context.Context):
|
|||||||
else:
|
else:
|
||||||
self.create_users()
|
self.create_users()
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `users`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
"""Delete tenants and users, using the broker pattern."""
|
"""Delete tenants and users, using the broker pattern."""
|
||||||
if self.existing_users:
|
if self.existing_users:
|
||||||
|
@ -21,8 +21,6 @@ from cryptography.hazmat.primitives import serialization
|
|||||||
from cryptography import x509
|
from cryptography import x509
|
||||||
from cryptography.x509 import oid
|
from cryptography.x509 import oid
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import utils as rutils
|
from rally.common import utils as rutils
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
from rally import consts
|
from rally import consts
|
||||||
@ -30,9 +28,6 @@ from rally.plugins.openstack.scenarios.magnum import utils as magnum_utils
|
|||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
@validation.add("required_platform", platform="openstack", users=True)
|
||||||
@context.configure(name="ca_certs", platform="openstack", order=490)
|
@context.configure(name="ca_certs", platform="openstack", order=490)
|
||||||
class CaCertGenerator(context.Context):
|
class CaCertGenerator(context.Context):
|
||||||
@ -70,7 +65,6 @@ class CaCertGenerator(context.Context):
|
|||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `Ca Cert`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
for user, tenant_id in rutils.iterate_per_tenants(
|
for user, tenant_id in rutils.iterate_per_tenants(
|
||||||
self.context["users"]):
|
self.context["users"]):
|
||||||
@ -110,7 +104,6 @@ class CaCertGenerator(context.Context):
|
|||||||
with open(fname, "w") as cert_file:
|
with open(fname, "w") as cert_file:
|
||||||
cert_file.write(cert.pem)
|
cert_file.write(cert.pem)
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `Ca Cert`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
for user, tenant_id in rutils.iterate_per_tenants(
|
for user, tenant_id in rutils.iterate_per_tenants(
|
||||||
self.context["users"]):
|
self.context["users"]):
|
||||||
|
@ -12,8 +12,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import utils as rutils
|
from rally.common import utils as rutils
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
from rally import consts
|
from rally import consts
|
||||||
@ -22,9 +20,6 @@ from rally.plugins.openstack.scenarios.magnum import utils as magnum_utils
|
|||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
@validation.add("required_platform", platform="openstack", users=True)
|
||||||
@context.configure(name="cluster_templates", platform="openstack", order=470)
|
@context.configure(name="cluster_templates", platform="openstack", order=470)
|
||||||
class ClusterTemplateGenerator(context.Context):
|
class ClusterTemplateGenerator(context.Context):
|
||||||
@ -102,7 +97,6 @@ class ClusterTemplateGenerator(context.Context):
|
|||||||
"additionalProperties": False
|
"additionalProperties": False
|
||||||
}
|
}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `ClusterTemplate`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
for user, tenant_id in rutils.iterate_per_tenants(
|
for user, tenant_id in rutils.iterate_per_tenants(
|
||||||
self.context["users"]):
|
self.context["users"]):
|
||||||
@ -121,7 +115,6 @@ class ClusterTemplateGenerator(context.Context):
|
|||||||
ct_uuid = cluster_template.uuid
|
ct_uuid = cluster_template.uuid
|
||||||
self.context["tenants"][tenant_id]["cluster_template"] = ct_uuid
|
self.context["tenants"][tenant_id]["cluster_template"] = ct_uuid
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `ClusterTemplate`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
resource_manager.cleanup(
|
resource_manager.cleanup(
|
||||||
names=["magnum.cluster_templates"],
|
names=["magnum.cluster_templates"],
|
||||||
|
@ -12,8 +12,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import utils as rutils
|
from rally.common import utils as rutils
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
from rally import consts
|
from rally import consts
|
||||||
@ -23,9 +21,6 @@ from rally.plugins.openstack.scenarios.nova import utils as nova_utils
|
|||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
@validation.add("required_platform", platform="openstack", users=True)
|
||||||
@context.configure(name="clusters", platform="openstack", order=480)
|
@context.configure(name="clusters", platform="openstack", order=480)
|
||||||
class ClusterGenerator(context.Context):
|
class ClusterGenerator(context.Context):
|
||||||
@ -48,7 +43,6 @@ class ClusterGenerator(context.Context):
|
|||||||
|
|
||||||
DEFAULT_CONFIG = {"node_count": 1}
|
DEFAULT_CONFIG = {"node_count": 1}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `Cluster`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
for user, tenant_id in rutils.iterate_per_tenants(
|
for user, tenant_id in rutils.iterate_per_tenants(
|
||||||
self.context["users"]):
|
self.context["users"]):
|
||||||
@ -79,7 +73,6 @@ class ClusterGenerator(context.Context):
|
|||||||
node_count=self.config.get("node_count"), keypair=keypair)
|
node_count=self.config.get("node_count"), keypair=keypair)
|
||||||
self.context["tenants"][tenant_id]["cluster"] = cluster.uuid
|
self.context["tenants"][tenant_id]["cluster"] = cluster.uuid
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `Cluster`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
resource_manager.cleanup(
|
resource_manager.cleanup(
|
||||||
names=["magnum.clusters", "nova.keypairs"],
|
names=["magnum.clusters", "nova.keypairs"],
|
||||||
|
@ -15,8 +15,6 @@
|
|||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import utils
|
from rally.common import utils
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
from rally import consts as rally_consts
|
from rally import consts as rally_consts
|
||||||
@ -26,8 +24,6 @@ from rally.plugins.openstack.scenarios.manila import utils as manila_utils
|
|||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
CONTEXT_NAME = consts.SECURITY_SERVICES_CONTEXT_NAME
|
CONTEXT_NAME = consts.SECURITY_SERVICES_CONTEXT_NAME
|
||||||
|
|
||||||
|
|
||||||
@ -67,8 +63,6 @@ class SecurityServices(context.Context):
|
|||||||
"security_services": [],
|
"security_services": [],
|
||||||
}
|
}
|
||||||
|
|
||||||
@logging.log_task_wrapper(
|
|
||||||
LOG.info, _("Enter context: `%s`") % CONTEXT_NAME)
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
for user, tenant_id in (utils.iterate_per_tenants(
|
for user, tenant_id in (utils.iterate_per_tenants(
|
||||||
self.context.get("users", []))):
|
self.context.get("users", []))):
|
||||||
@ -90,7 +84,6 @@ class SecurityServices(context.Context):
|
|||||||
self.context["tenants"][tenant_id][CONTEXT_NAME][
|
self.context["tenants"][tenant_id][CONTEXT_NAME][
|
||||||
"security_services"].append(inst)
|
"security_services"].append(inst)
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `%s`") % CONTEXT_NAME)
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
resource_manager.cleanup(
|
resource_manager.cleanup(
|
||||||
names=["manila.security_services"],
|
names=["manila.security_services"],
|
||||||
|
@ -185,8 +185,6 @@ class ShareNetworks(context.Context):
|
|||||||
else:
|
else:
|
||||||
_setup_share_network(tenant_id, data)
|
_setup_share_network(tenant_id, data)
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `%s`")
|
|
||||||
% CONTEXT_NAME)
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
self.context[CONTEXT_NAME] = {}
|
self.context[CONTEXT_NAME] = {}
|
||||||
if not self.config["use_share_networks"]:
|
if not self.config["use_share_networks"]:
|
||||||
@ -196,7 +194,6 @@ class ShareNetworks(context.Context):
|
|||||||
else:
|
else:
|
||||||
self._setup_for_autocreated_users()
|
self._setup_for_autocreated_users()
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `%s`") % CONTEXT_NAME)
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
if (not self.context["config"].get("existing_users") or
|
if (not self.context["config"].get("existing_users") or
|
||||||
self.config["use_share_networks"]):
|
self.config["use_share_networks"]):
|
||||||
|
@ -15,8 +15,6 @@
|
|||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import utils
|
from rally.common import utils
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
from rally import consts as rally_consts
|
from rally import consts as rally_consts
|
||||||
@ -26,8 +24,6 @@ from rally.plugins.openstack.scenarios.manila import utils as manila_utils
|
|||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
CONTEXT_NAME = consts.SHARES_CONTEXT_NAME
|
CONTEXT_NAME = consts.SHARES_CONTEXT_NAME
|
||||||
|
|
||||||
|
|
||||||
@ -81,8 +77,6 @@ class Shares(context.Context):
|
|||||||
share = manila_scenario._create_share(**kwargs)
|
share = manila_scenario._create_share(**kwargs)
|
||||||
tenant_ctxt["shares"].append(share.to_dict())
|
tenant_ctxt["shares"].append(share.to_dict())
|
||||||
|
|
||||||
@logging.log_task_wrapper(
|
|
||||||
LOG.info, _("Enter context: `%s`") % CONTEXT_NAME)
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
for user, tenant_id in (
|
for user, tenant_id in (
|
||||||
utils.iterate_per_tenants(self.context.get("users", []))):
|
utils.iterate_per_tenants(self.context.get("users", []))):
|
||||||
@ -102,7 +96,6 @@ class Shares(context.Context):
|
|||||||
self.config["share_type"],
|
self.config["share_type"],
|
||||||
)
|
)
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `%s`") % CONTEXT_NAME)
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
resource_manager.cleanup(
|
resource_manager.cleanup(
|
||||||
names=["manila.shares"],
|
names=["manila.shares"],
|
||||||
|
@ -14,8 +14,6 @@
|
|||||||
|
|
||||||
from six import moves
|
from six import moves
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import utils as rutils
|
from rally.common import utils as rutils
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
from rally import consts
|
from rally import consts
|
||||||
@ -23,9 +21,6 @@ from rally.plugins.openstack.scenarios.monasca import utils as monasca_utils
|
|||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
@validation.add("required_platform", platform="openstack", users=True)
|
||||||
@context.configure(name="monasca_metrics", platform="openstack", order=510)
|
@context.configure(name="monasca_metrics", platform="openstack", order=510)
|
||||||
class MonascaMetricGenerator(context.Context):
|
class MonascaMetricGenerator(context.Context):
|
||||||
@ -81,7 +76,6 @@ class MonascaMetricGenerator(context.Context):
|
|||||||
"metrics_per_tenant": 2
|
"metrics_per_tenant": 2
|
||||||
}
|
}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `Monasca`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
new_metric = {}
|
new_metric = {}
|
||||||
|
|
||||||
@ -102,7 +96,6 @@ class MonascaMetricGenerator(context.Context):
|
|||||||
monasca_utils.CONF.benchmark.monasca_metric_create_prepoll_delay,
|
monasca_utils.CONF.benchmark.monasca_metric_create_prepoll_delay,
|
||||||
atomic_delay=1)
|
atomic_delay=1)
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `Monasca`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
# We don't have API for removal of metrics
|
# We don't have API for removal of metrics
|
||||||
pass
|
pass
|
||||||
|
@ -13,8 +13,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import utils
|
from rally.common import utils
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
from rally import consts
|
from rally import consts
|
||||||
@ -23,9 +21,6 @@ from rally.plugins.openstack.scenarios.murano import utils as murano_utils
|
|||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
@validation.add("required_platform", platform="openstack", users=True)
|
||||||
@context.configure(name="murano_environments", platform="openstack", order=402)
|
@context.configure(name="murano_environments", platform="openstack", order=402)
|
||||||
class EnvironmentGenerator(context.Context):
|
class EnvironmentGenerator(context.Context):
|
||||||
@ -44,8 +39,6 @@ class EnvironmentGenerator(context.Context):
|
|||||||
"additionalProperties": False
|
"additionalProperties": False
|
||||||
}
|
}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info,
|
|
||||||
_("Enter context: `Murano environments`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
for user, tenant_id in utils.iterate_per_tenants(
|
for user, tenant_id in utils.iterate_per_tenants(
|
||||||
self.context["users"]):
|
self.context["users"]):
|
||||||
@ -59,8 +52,6 @@ class EnvironmentGenerator(context.Context):
|
|||||||
env = murano_util._create_environment()
|
env = murano_util._create_environment()
|
||||||
self.context["tenants"][tenant_id]["environments"].append(env)
|
self.context["tenants"][tenant_id]["environments"].append(env)
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info,
|
|
||||||
_("Exit context: `Murano environments`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
resource_manager.cleanup(names=["murano.environments"],
|
resource_manager.cleanup(names=["murano.environments"],
|
||||||
users=self.context.get("users", []),
|
users=self.context.get("users", []),
|
||||||
|
@ -17,9 +17,6 @@ import os
|
|||||||
import zipfile
|
import zipfile
|
||||||
|
|
||||||
from rally.common import fileutils
|
from rally.common import fileutils
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common.i18n import _LE
|
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import utils
|
from rally.common import utils
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
from rally import consts
|
from rally import consts
|
||||||
@ -29,9 +26,6 @@ from rally.plugins.openstack.cleanup import manager as resource_manager
|
|||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
@validation.add("required_platform", platform="openstack", users=True)
|
||||||
@context.configure(name="murano_packages", platform="openstack", order=401)
|
@context.configure(name="murano_packages", platform="openstack", order=401)
|
||||||
class PackageGenerator(context.Context):
|
class PackageGenerator(context.Context):
|
||||||
@ -49,7 +43,6 @@ class PackageGenerator(context.Context):
|
|||||||
"additionalProperties": False
|
"additionalProperties": False
|
||||||
}
|
}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `Murano packages`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
is_config_app_dir = False
|
is_config_app_dir = False
|
||||||
pckg_path = os.path.expanduser(self.config["app_package"])
|
pckg_path = os.path.expanduser(self.config["app_package"])
|
||||||
@ -59,9 +52,8 @@ class PackageGenerator(context.Context):
|
|||||||
is_config_app_dir = True
|
is_config_app_dir = True
|
||||||
zip_name = fileutils.pack_dir(pckg_path)
|
zip_name = fileutils.pack_dir(pckg_path)
|
||||||
else:
|
else:
|
||||||
msg = (_LE("There is no zip archive or directory by this path:"
|
msg = "There is no zip archive or directory by this path: %s"
|
||||||
" %s") % pckg_path)
|
raise exceptions.ContextSetupFailure(msg=msg % pckg_path,
|
||||||
raise exceptions.ContextSetupFailure(msg=msg,
|
|
||||||
ctx_name=self.get_name())
|
ctx_name=self.get_name())
|
||||||
|
|
||||||
for user, tenant_id in utils.iterate_per_tenants(
|
for user, tenant_id in utils.iterate_per_tenants(
|
||||||
@ -77,7 +69,6 @@ class PackageGenerator(context.Context):
|
|||||||
|
|
||||||
self.context["tenants"][tenant_id]["packages"].append(package)
|
self.context["tenants"][tenant_id]["packages"].append(package)
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `Murano packages`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
resource_manager.cleanup(names=["murano.packages"],
|
resource_manager.cleanup(names=["murano.packages"],
|
||||||
users=self.context.get("users", []),
|
users=self.context.get("users", []),
|
||||||
|
@ -88,7 +88,6 @@ def _prepare_open_secgroup(credential, secgroup_name):
|
|||||||
class AllowSSH(context.Context):
|
class AllowSSH(context.Context):
|
||||||
"""Sets up security groups for all users to access VM via SSH."""
|
"""Sets up security groups for all users to access VM via SSH."""
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `allow_ssh`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
admin_or_user = (self.context.get("admin") or
|
admin_or_user = (self.context.get("admin") or
|
||||||
self.context.get("users")[0])
|
self.context.get("users")[0])
|
||||||
@ -106,7 +105,6 @@ class AllowSSH(context.Context):
|
|||||||
user["secgroup"] = _prepare_open_secgroup(user["credential"],
|
user["secgroup"] = _prepare_open_secgroup(user["credential"],
|
||||||
secgroup_name)
|
secgroup_name)
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `allow_ssh`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
for user, tenant_id in utils.iterate_per_tenants(
|
for user, tenant_id in utils.iterate_per_tenants(
|
||||||
self.context["users"]):
|
self.context["users"]):
|
||||||
|
@ -12,9 +12,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import utils
|
from rally.common import utils
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
from rally import consts
|
from rally import consts
|
||||||
@ -23,9 +20,6 @@ from rally.plugins.openstack.wrappers import network as network_wrapper
|
|||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
@validation.add("required_platform", platform="openstack", users=True)
|
||||||
@context.configure(name="existing_network", platform="openstack", order=349)
|
@context.configure(name="existing_network", platform="openstack", order=349)
|
||||||
class ExistingNetwork(context.Context):
|
class ExistingNetwork(context.Context):
|
||||||
@ -40,7 +34,6 @@ class ExistingNetwork(context.Context):
|
|||||||
"additionalProperties": False
|
"additionalProperties": False
|
||||||
}
|
}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `existing_network`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
for user, tenant_id in utils.iterate_per_tenants(
|
for user, tenant_id in utils.iterate_per_tenants(
|
||||||
self.context.get("users", [])):
|
self.context.get("users", [])):
|
||||||
@ -50,6 +43,5 @@ class ExistingNetwork(context.Context):
|
|||||||
self.context["tenants"][tenant_id]["networks"] = (
|
self.context["tenants"][tenant_id]["networks"] = (
|
||||||
net_wrapper.list_networks())
|
net_wrapper.list_networks())
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `existing_network`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
"""Networks were not created by Rally, so nothing to do."""
|
"""Networks were not created by Rally, so nothing to do."""
|
||||||
|
@ -73,7 +73,6 @@ class Network(context.Context):
|
|||||||
"dns_nameservers": None
|
"dns_nameservers": None
|
||||||
}
|
}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `network`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
# NOTE(rkiran): Some clients are not thread-safe. Thus during
|
# NOTE(rkiran): Some clients are not thread-safe. Thus during
|
||||||
# multithreading/multiprocessing, it is likely the
|
# multithreading/multiprocessing, it is likely the
|
||||||
@ -100,7 +99,6 @@ class Network(context.Context):
|
|||||||
**kwargs)
|
**kwargs)
|
||||||
self.context["tenants"][tenant_id]["networks"].append(network)
|
self.context["tenants"][tenant_id]["networks"].append(network)
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `network`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
net_wrapper = network_wrapper.wrap(
|
net_wrapper = network_wrapper.wrap(
|
||||||
osclients.Clients(self.context["admin"]["credential"]),
|
osclients.Clients(self.context["admin"]["credential"]),
|
||||||
|
@ -13,8 +13,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import utils
|
from rally.common import utils
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
from rally import consts
|
from rally import consts
|
||||||
@ -23,9 +21,6 @@ from rally.plugins.openstack.scenarios.neutron import utils as neutron_utils
|
|||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_platform", platform="openstack", admin=True,
|
@validation.add("required_platform", platform="openstack", admin=True,
|
||||||
users=True)
|
users=True)
|
||||||
@context.configure(name="router", platform="openstack", order=351)
|
@context.configure(name="router", platform="openstack", order=351)
|
||||||
@ -90,7 +85,6 @@ class Router(context.Context):
|
|||||||
"routers_per_tenant": 1,
|
"routers_per_tenant": 1,
|
||||||
}
|
}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `router`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
kwargs = {}
|
kwargs = {}
|
||||||
parameters = ("admin_state_up", "external_gateway_info", "network_id",
|
parameters = ("admin_state_up", "external_gateway_info", "network_id",
|
||||||
@ -110,7 +104,6 @@ class Router(context.Context):
|
|||||||
router = scenario._create_router(kwargs)
|
router = scenario._create_router(kwargs)
|
||||||
self.context["tenants"][tenant_id]["routers"].append(router)
|
self.context["tenants"][tenant_id]["routers"].append(router)
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `router`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
resource_manager.cleanup(
|
resource_manager.cleanup(
|
||||||
names=["neutron.router"],
|
names=["neutron.router"],
|
||||||
|
@ -51,7 +51,6 @@ class Lbaas(context.Context):
|
|||||||
"lbaas_version": 1
|
"lbaas_version": 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `lbaas`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
net_wrapper = network_wrapper.wrap(
|
net_wrapper = network_wrapper.wrap(
|
||||||
osclients.Clients(self.context["admin"]["credential"]),
|
osclients.Clients(self.context["admin"]["credential"]),
|
||||||
@ -78,7 +77,6 @@ class Lbaas(context.Context):
|
|||||||
"Context for LBaaS version %s not implemented."
|
"Context for LBaaS version %s not implemented."
|
||||||
% self.config["lbaas_version"])
|
% self.config["lbaas_version"])
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `lbaas`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
net_wrapper = network_wrapper.wrap(
|
net_wrapper = network_wrapper.wrap(
|
||||||
osclients.Clients(self.context["admin"]["credential"]),
|
osclients.Clients(self.context["admin"]["credential"]),
|
||||||
|
@ -13,9 +13,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from novaclient import exceptions as nova_exceptions
|
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
from rally.common import logging
|
||||||
from rally.common import utils as rutils
|
from rally.common import utils as rutils
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
@ -73,9 +70,10 @@ class FlavorsGenerator(context.Context):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `flavors`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
"""Create list of flavors."""
|
"""Create list of flavors."""
|
||||||
|
from novaclient import exceptions as nova_exceptions
|
||||||
|
|
||||||
self.context["flavors"] = {}
|
self.context["flavors"] = {}
|
||||||
|
|
||||||
clients = osclients.Clients(self.context["admin"]["credential"])
|
clients = osclients.Clients(self.context["admin"]["credential"])
|
||||||
@ -99,7 +97,6 @@ class FlavorsGenerator(context.Context):
|
|||||||
self.context["flavors"][flavor_config["name"]] = flavor.to_dict()
|
self.context["flavors"][flavor_config["name"]] = flavor.to_dict()
|
||||||
LOG.debug("Created flavor with id '%s'", flavor.id)
|
LOG.debug("Created flavor with id '%s'", flavor.id)
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `flavors`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
"""Delete created flavors."""
|
"""Delete created flavors."""
|
||||||
mather = rutils.make_name_matcher(*[f["name"] for f in self.config])
|
mather = rutils.make_name_matcher(*[f["name"] for f in self.config])
|
||||||
|
@ -13,17 +13,12 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
from rally import osclients
|
from rally import osclients
|
||||||
from rally.plugins.openstack.cleanup import manager as resource_manager
|
from rally.plugins.openstack.cleanup import manager as resource_manager
|
||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
@validation.add("required_platform", platform="openstack", users=True)
|
||||||
@context.configure(name="keypair", platform="openstack", order=310)
|
@context.configure(name="keypair", platform="openstack", order=310)
|
||||||
class Keypair(context.Context):
|
class Keypair(context.Context):
|
||||||
@ -52,12 +47,10 @@ class Keypair(context.Context):
|
|||||||
"name": keypair_name,
|
"name": keypair_name,
|
||||||
"id": keypair.id}
|
"id": keypair.id}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `keypair`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
for user in self.context["users"]:
|
for user in self.context["users"]:
|
||||||
user["keypair"] = self._generate_keypair(user["credential"])
|
user["keypair"] = self._generate_keypair(user["credential"])
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `keypair`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
resource_manager.cleanup(names=["nova.keypairs"],
|
resource_manager.cleanup(names=["nova.keypairs"],
|
||||||
users=self.context.get("users", []),
|
users=self.context.get("users", []),
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
from rally.common import logging
|
||||||
from rally.common import utils as rutils
|
from rally.common import utils as rutils
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
@ -78,7 +77,6 @@ class ServerGenerator(context.Context):
|
|||||||
"auto_assign_nic": False
|
"auto_assign_nic": False
|
||||||
}
|
}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `Servers`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
image = self.config["image"]
|
image = self.config["image"]
|
||||||
flavor = self.config["flavor"]
|
flavor = self.config["flavor"]
|
||||||
@ -130,7 +128,6 @@ class ServerGenerator(context.Context):
|
|||||||
self.context["tenants"][tenant_id][
|
self.context["tenants"][tenant_id][
|
||||||
"servers"] = current_servers
|
"servers"] = current_servers
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `Servers`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
resource_manager.cleanup(names=["nova.servers"],
|
resource_manager.cleanup(names=["nova.servers"],
|
||||||
users=self.context.get("users", []),
|
users=self.context.get("users", []),
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
from rally.common import logging
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
from rally import consts
|
from rally import consts
|
||||||
@ -65,7 +64,6 @@ class Quotas(context.Context):
|
|||||||
def _service_has_quotas(self, service):
|
def _service_has_quotas(self, service):
|
||||||
return len(self.config.get(service, {})) > 0
|
return len(self.config.get(service, {})) > 0
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `quotas`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
for tenant_id in self.context["tenants"]:
|
for tenant_id in self.context["tenants"]:
|
||||||
for service in self.manager:
|
for service in self.manager:
|
||||||
@ -103,7 +101,6 @@ class Quotas(context.Context):
|
|||||||
% {"tenant_id": tenant_id,
|
% {"tenant_id": tenant_id,
|
||||||
"service": service, "exc": e})
|
"service": service, "exc": e})
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `quotas`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
if self.original_quotas:
|
if self.original_quotas:
|
||||||
# existing users
|
# existing users
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
from rally.common.i18n import _
|
from rally.common.i18n import _
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import utils as rutils
|
from rally.common import utils as rutils
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
from rally import consts
|
from rally import consts
|
||||||
@ -28,7 +27,6 @@ from rally.task import utils as bench_utils
|
|||||||
|
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
@validation.add("required_platform", platform="openstack", users=True)
|
||||||
@ -100,7 +98,6 @@ class SaharaCluster(context.Context):
|
|||||||
"master_flavor_id", "worker_flavor_id"]
|
"master_flavor_id", "worker_flavor_id"]
|
||||||
}
|
}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `Sahara Cluster`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
utils.init_sahara_context(self)
|
utils.init_sahara_context(self)
|
||||||
self.context["sahara"]["clusters"] = {}
|
self.context["sahara"]["clusters"] = {}
|
||||||
@ -181,7 +178,6 @@ class SaharaCluster(context.Context):
|
|||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `Sahara Cluster`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
resource_manager.cleanup(names=["sahara.clusters"],
|
resource_manager.cleanup(names=["sahara.clusters"],
|
||||||
users=self.context.get("users", []),
|
users=self.context.get("users", []),
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from rally.common.i18n import _
|
from rally.common.i18n import _
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import utils as rutils
|
from rally.common import utils as rutils
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
from rally import consts
|
from rally import consts
|
||||||
@ -25,9 +24,6 @@ from rally.plugins.openstack.services.image import image as image_services
|
|||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
@validation.add("required_platform", platform="openstack", users=True)
|
||||||
@context.configure(name="sahara_image", platform="openstack", order=440)
|
@context.configure(name="sahara_image", platform="openstack", order=440)
|
||||||
class SaharaImage(context.Context):
|
class SaharaImage(context.Context):
|
||||||
@ -79,7 +75,6 @@ class SaharaImage(context.Context):
|
|||||||
image_id=image.id, new_tags=[plugin_name, hadoop_version])
|
image_id=image.id, new_tags=[plugin_name, hadoop_version])
|
||||||
return image.id
|
return image.id
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `Sahara Image`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
utils.init_sahara_context(self)
|
utils.init_sahara_context(self)
|
||||||
self.context["sahara"]["images"] = {}
|
self.context["sahara"]["images"] = {}
|
||||||
@ -129,7 +124,6 @@ class SaharaImage(context.Context):
|
|||||||
self.context["tenants"][tenant_id]["sahara"]["image"] = (
|
self.context["tenants"][tenant_id]["sahara"]["image"] = (
|
||||||
image_id)
|
image_id)
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `Sahara Image`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
if self.context["sahara"]["need_image_cleanup"]:
|
if self.context["sahara"]["need_image_cleanup"]:
|
||||||
resource_manager.cleanup(names=["glance.images"],
|
resource_manager.cleanup(names=["glance.images"],
|
||||||
|
@ -16,8 +16,6 @@
|
|||||||
import requests
|
import requests
|
||||||
from six.moves.urllib import parse
|
from six.moves.urllib import parse
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import utils as rutils
|
from rally.common import utils as rutils
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
from rally import consts
|
from rally import consts
|
||||||
@ -28,9 +26,6 @@ from rally.plugins.openstack.scenarios.swift import utils as swift_utils
|
|||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
@validation.add("required_platform", platform="openstack", users=True)
|
||||||
@context.configure(name="sahara_input_data_sources", platform="openstack",
|
@context.configure(name="sahara_input_data_sources", platform="openstack",
|
||||||
order=443)
|
order=443)
|
||||||
@ -68,8 +63,6 @@ class SaharaInputDataSources(context.Context):
|
|||||||
"required": ["input_type", "input_url"]
|
"required": ["input_type", "input_url"]
|
||||||
}
|
}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info,
|
|
||||||
_("Enter context: `Sahara Input Data Sources`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
utils.init_sahara_context(self)
|
utils.init_sahara_context(self)
|
||||||
self.context["sahara"]["swift_objects"] = []
|
self.context["sahara"]["swift_objects"] = []
|
||||||
@ -121,8 +114,6 @@ class SaharaInputDataSources(context.Context):
|
|||||||
self.context["tenants"][tenant_id]["sahara"]["input"] = (
|
self.context["tenants"][tenant_id]["sahara"]["input"] = (
|
||||||
input_ds_swift.id)
|
input_ds_swift.id)
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `Sahara Input Data"
|
|
||||||
"Sources`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
resource_manager.cleanup(
|
resource_manager.cleanup(
|
||||||
names=["swift.object", "swift.container"],
|
names=["swift.object", "swift.container"],
|
||||||
|
@ -15,8 +15,6 @@
|
|||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import utils as rutils
|
from rally.common import utils as rutils
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
from rally import consts
|
from rally import consts
|
||||||
@ -27,9 +25,6 @@ from rally.plugins.openstack.scenarios.sahara import utils
|
|||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
@validation.add("required_platform", platform="openstack", users=True)
|
||||||
@context.configure(name="sahara_job_binaries", platform="openstack", order=442)
|
@context.configure(name="sahara_job_binaries", platform="openstack", order=442)
|
||||||
class SaharaJobBinaries(context.Context):
|
class SaharaJobBinaries(context.Context):
|
||||||
@ -79,8 +74,6 @@ class SaharaJobBinaries(context.Context):
|
|||||||
# downloads for each tenant
|
# downloads for each tenant
|
||||||
lib_cache = {}
|
lib_cache = {}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info,
|
|
||||||
_("Enter context: `Sahara Job Binaries`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
utils.init_sahara_context(self)
|
utils.init_sahara_context(self)
|
||||||
for user, tenant_id in rutils.iterate_per_tenants(
|
for user, tenant_id in rutils.iterate_per_tenants(
|
||||||
@ -142,8 +135,6 @@ class SaharaJobBinaries(context.Context):
|
|||||||
self.context["tenants"][tenant_id]["sahara"][lib_type].append(
|
self.context["tenants"][tenant_id]["sahara"][lib_type].append(
|
||||||
job_binary.id)
|
job_binary.id)
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info,
|
|
||||||
_("Exit context: `Sahara Job Binaries`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
resources = ["job_binary_internals", "job_binaries"]
|
resources = ["job_binary_internals", "job_binaries"]
|
||||||
|
|
||||||
|
@ -13,8 +13,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import utils as rutils
|
from rally.common import utils as rutils
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
from rally import consts
|
from rally import consts
|
||||||
@ -25,9 +23,6 @@ from rally.plugins.openstack.scenarios.swift import utils as swift_utils
|
|||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
@validation.add("required_platform", platform="openstack", users=True)
|
||||||
@context.configure(name="sahara_output_data_sources", platform="openstack",
|
@context.configure(name="sahara_output_data_sources", platform="openstack",
|
||||||
order=444)
|
order=444)
|
||||||
@ -49,8 +44,6 @@ class SaharaOutputDataSources(context.Context):
|
|||||||
"required": ["output_type", "output_url_prefix"]
|
"required": ["output_type", "output_url_prefix"]
|
||||||
}
|
}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info,
|
|
||||||
_("Enter context: `Sahara Output Data Sources`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
utils.init_sahara_context(self)
|
utils.init_sahara_context(self)
|
||||||
for user, tenant_id in rutils.iterate_per_tenants(
|
for user, tenant_id in rutils.iterate_per_tenants(
|
||||||
@ -99,8 +92,6 @@ class SaharaOutputDataSources(context.Context):
|
|||||||
output_ds_swift.id
|
output_ds_swift.id
|
||||||
)
|
)
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info,
|
|
||||||
_("Exit context: `Sahara Output Data Sources`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
resource_manager.cleanup(
|
resource_manager.cleanup(
|
||||||
names=["swift.object", "swift.container"],
|
names=["swift.object", "swift.container"],
|
||||||
|
@ -10,16 +10,12 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import utils as rutils
|
from rally.common import utils as rutils
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
from rally import consts
|
from rally import consts
|
||||||
from rally.plugins.openstack.scenarios.senlin import utils as senlin_utils
|
from rally.plugins.openstack.scenarios.senlin import utils as senlin_utils
|
||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_platform", platform="openstack", users=True)
|
@validation.add("required_platform", platform="openstack", users=True)
|
||||||
@context.configure(name="profiles", platform="openstack", order=190)
|
@context.configure(name="profiles", platform="openstack", order=190)
|
||||||
@ -44,7 +40,6 @@ class ProfilesGenerator(context.Context):
|
|||||||
"required": ["type", "version", "properties"]
|
"required": ["type", "version", "properties"]
|
||||||
}
|
}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `Senlin profiles`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
"""Create test profiles."""
|
"""Create test profiles."""
|
||||||
for user, tenant_id in rutils.iterate_per_tenants(
|
for user, tenant_id in rutils.iterate_per_tenants(
|
||||||
@ -61,7 +56,6 @@ class ProfilesGenerator(context.Context):
|
|||||||
|
|
||||||
self.context["tenants"][tenant_id]["profile"] = profile.id
|
self.context["tenants"][tenant_id]["profile"] = profile.id
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `Senlin profiles`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
"""Delete created test profiles."""
|
"""Delete created test profiles."""
|
||||||
for user, tenant_id in rutils.iterate_per_tenants(
|
for user, tenant_id in rutils.iterate_per_tenants(
|
||||||
|
@ -59,7 +59,6 @@ class SwiftObjectGenerator(swift_utils.SwiftObjectMixin, context.Context):
|
|||||||
"resource_management_workers": 30
|
"resource_management_workers": 30
|
||||||
}
|
}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `swift_objects`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
"""Create containers and objects, using the broker pattern."""
|
"""Create containers and objects, using the broker pattern."""
|
||||||
threads = self.config["resource_management_workers"]
|
threads = self.config["resource_management_workers"]
|
||||||
@ -93,7 +92,6 @@ class SwiftObjectGenerator(swift_utils.SwiftObjectMixin, context.Context):
|
|||||||
"expected %(expected)s but got %(actual)s.")
|
"expected %(expected)s but got %(actual)s.")
|
||||||
% {"expected": objects_num, "actual": objects_count})
|
% {"expected": objects_num, "actual": objects_count})
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `swift_objects`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
"""Delete containers and objects, using the broker pattern."""
|
"""Delete containers and objects, using the broker pattern."""
|
||||||
threads = self.config["resource_management_workers"]
|
threads = self.config["resource_management_workers"]
|
||||||
|
@ -101,7 +101,6 @@ class BaseCustomImageGenerator(context.Context):
|
|||||||
"workers": 1
|
"workers": 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `custom_image`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
"""Creates custom image(s) with preinstalled applications.
|
"""Creates custom image(s) with preinstalled applications.
|
||||||
|
|
||||||
@ -178,7 +177,6 @@ class BaseCustomImageGenerator(context.Context):
|
|||||||
|
|
||||||
return custom_image
|
return custom_image
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `custom_image`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
"""Delete created custom image(s)."""
|
"""Delete created custom image(s)."""
|
||||||
|
|
||||||
|
@ -16,8 +16,6 @@ import random
|
|||||||
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from rally.common.i18n import _
|
|
||||||
from rally.common import logging
|
|
||||||
from rally.common import validation
|
from rally.common import validation
|
||||||
from rally import consts
|
from rally import consts
|
||||||
from rally import osclients
|
from rally import osclients
|
||||||
@ -27,9 +25,6 @@ from rally.plugins.openstack import types
|
|||||||
from rally.task import context
|
from rally.task import context
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
|
|
||||||
@validation.add("required_platform", platform="openstack", admin=True)
|
@validation.add("required_platform", platform="openstack", admin=True)
|
||||||
@context.configure(name="audit_templates", platform="openstack", order=550)
|
@context.configure(name="audit_templates", platform="openstack", order=550)
|
||||||
class AuditTemplateGenerator(context.Context):
|
class AuditTemplateGenerator(context.Context):
|
||||||
@ -77,7 +72,6 @@ class AuditTemplateGenerator(context.Context):
|
|||||||
"fill_strategy": "round_robin"
|
"fill_strategy": "round_robin"
|
||||||
}
|
}
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Enter context: `Audit Templates`"))
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
watcher_scenario = watcher_utils.WatcherScenario(
|
watcher_scenario = watcher_utils.WatcherScenario(
|
||||||
{"admin": self.context["admin"], "task": self.context["task"],
|
{"admin": self.context["admin"], "task": self.context["task"],
|
||||||
@ -108,7 +102,6 @@ class AuditTemplateGenerator(context.Context):
|
|||||||
goal_id, strategy_id)
|
goal_id, strategy_id)
|
||||||
self.context["audit_templates"].append(audit_template.uuid)
|
self.context["audit_templates"].append(audit_template.uuid)
|
||||||
|
|
||||||
@logging.log_task_wrapper(LOG.info, _("Exit context: `Audit Templates`"))
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
resource_manager.cleanup(names=["watcher.action_plan",
|
resource_manager.cleanup(names=["watcher.action_plan",
|
||||||
"watcher.audit_template"],
|
"watcher.audit_template"],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user