From 6cb22c40cfdd282a69e14c7f9e545c1835df356f Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Mon, 30 Jun 2014 23:26:30 +0000 Subject: [PATCH] Config setting for build diag timeoute Change-Id: Ia1cac035d1fc640394ac0e933a7c3e69ef55081a --- etc/libra.cfg | 1 + libra/mgm/__init__.py | 5 ++++- libra/mgm/controllers/build.py | 5 ++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/etc/libra.cfg b/etc/libra.cfg index bdfd9b07..6bd05fdd 100644 --- a/etc/libra.cfg +++ b/etc/libra.cfg @@ -91,6 +91,7 @@ rabbit_use_ssl = True #threads = 8 #rm_fip_ignore_500 = false #nova_insecure = false +#build_diag_timeout = 10 # Required options az = 1 diff --git a/libra/mgm/__init__.py b/libra/mgm/__init__.py index 512f1652..b64863db 100644 --- a/libra/mgm/__init__.py +++ b/libra/mgm/__init__.py @@ -84,6 +84,9 @@ cfg.CONF.register_opts( cfg.IntOpt('threads', default=4, help='Number of worker threads to spawn'), - ], + cfg.IntOpt('build_diag_timeout', + default=10, + help='Timeout in seconds the pool manager will wait for a worker to complete the post-build diagnostic tests.'), + ], group=mgm_group ) diff --git a/libra/mgm/controllers/build.py b/libra/mgm/controllers/build.py index 0902b97a..a0e3360f 100644 --- a/libra/mgm/controllers/build.py +++ b/libra/mgm/controllers/build.py @@ -22,7 +22,6 @@ from libra.openstack.common import log from libra.mgm.nova import Node, BuildError, NotFound POLL_COUNT = 10 -POLL_SLEEP = 60 LOG = log.getLogger(__name__) @@ -162,11 +161,11 @@ class BuildController(object): client.submitJob(job) pollcount = 0 - # Would like to make these config file settings + pollsleepinterval = cfg.CONF['mgm']['build_diag_timeout'] / POLL_COUNT while not job.complete\ and pollcount < POLL_COUNT\ and not job.disconnect: - sleep(POLL_SLEEP) + sleep(pollsleepinterval) pollcount += 1 if job.disconnect: