diff --git a/etc/rally/rally.conf.sample b/etc/rally/rally.conf.sample index 19d51f1e0f..5ed7edb240 100644 --- a/etc/rally/rally.conf.sample +++ b/etc/rally/rally.conf.sample @@ -495,6 +495,16 @@ #ec2_server_boot_poll_interval = 1.0 +[cleanup] + +# +# From rally +# + +# A timeout in seconds for deleting resources (integer value) +#resource_deletion_timeout = 600 + + [database] # diff --git a/rally/common/opts.py b/rally/common/opts.py index 83216ced48..267b5cec0f 100644 --- a/rally/common/opts.py +++ b/rally/common/opts.py @@ -17,6 +17,7 @@ import itertools from rally.common import log from rally import exceptions from rally import osclients +from rally.plugins.openstack.context.cleanup import base as cleanup_base from rally.plugins.openstack.context.keystone import users from rally.plugins.openstack.scenarios.cinder import utils as cinder_utils from rally.plugins.openstack.scenarios.ec2 import utils as ec2_utils @@ -44,5 +45,6 @@ def list_opts(): ec2_utils.EC2_BENCHMARK_OPTS)), ("image", itertools.chain(tempest_conf.IMAGE_OPTS)), - ("users_context", itertools.chain(users.USER_CONTEXT_OPTS)) + ("users_context", itertools.chain(users.USER_CONTEXT_OPTS)), + ("cleanup", itertools.chain(cleanup_base.CLEANUP_OPTS)) ] diff --git a/rally/plugins/openstack/context/cleanup/base.py b/rally/plugins/openstack/context/cleanup/base.py index cf3fd1967e..cc92382528 100644 --- a/rally/plugins/openstack/context/cleanup/base.py +++ b/rally/plugins/openstack/context/cleanup/base.py @@ -13,12 +13,27 @@ # License for the specific language governing permissions and limitations # under the License. + +from oslo_config import cfg + from rally.task import utils +CONF = cfg.CONF + +CLEANUP_OPTS = [ + cfg.IntOpt("resource_deletion_timeout", default=600, + help="A timeout in seconds for deleting resources") +] +cleanup_group = cfg.OptGroup(name="cleanup", title="Cleanup Options") +CONF.register_group(cleanup_group) +CONF.register_opts(CLEANUP_OPTS, cleanup_group) + + def resource(service, resource, order=0, admin_required=False, perform_for_admin_only=False, tenant_resource=False, - max_attempts=3, timeout=600, interval=1, threads=20): + max_attempts=3, timeout=CONF.cleanup.resource_deletion_timeout, + interval=1, threads=20): """Decorator that overrides resource specification. Just put it on top of your resource class and specify arguments that you