Expose config for timeout of resource deletion

The users who run rally in CI or periodically would like this option,
because they could config this under different cases.

Change-Id: I6fd70eb5565aeeb0442475439633baf2f441d174
Partial-Bug: #1469622
This commit is contained in:
Kun Huang 2015-08-20 16:24:44 +08:00
parent a107ce1710
commit 34f0b8b023
2 changed files with 26 additions and 1 deletions

View File

@ -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]
#

View File

@ -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