Merge "Expose config for timeout of resource deletion"
This commit is contained in:
commit
d3a45d9228
@ -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]
|
||||
|
||||
#
|
||||
|
@ -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))
|
||||
]
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user