Increase default timeout for agents response to 1 hour

Makes this parameter configurable and it can be changed
in config file and/or in app definitions.

Change-Id: I3d5c0d5ff1fe39a8aea0727e5156f6450d96e3d8
Closes-Bug: #1461883
This commit is contained in:
Ekaterina Chernova 2015-06-11 14:11:35 +03:00 committed by Kirill Zaitsev
parent d5b1818d13
commit 700a7cb37c
2 changed files with 12 additions and 3 deletions

View File

@ -201,7 +201,10 @@ engine_opts = [
help=_("Create resources using trust token rather "
"than user's token")),
cfg.BoolOpt('enable_model_policy_enforcer', default=False,
help=_('Enable model policy enforcer using Congress'))
help=_('Enable model policy enforcer using Congress')),
cfg.IntOpt('agent_timeout', default=3600,
help=_('Time for waiting for a response from murano agent'
'during the deployment'))
]
# TODO(sjmc7): move into engine opts?

View File

@ -22,6 +22,7 @@ import urlparse
import uuid
import eventlet.event
from oslo_config import cfg
import murano.common.config as config
import murano.common.exceptions as exceptions
@ -32,6 +33,7 @@ import murano.dsl.yaql_expression as yaql_expression
import murano.engine.system.common as common
LOG = logging.getLogger(__name__)
CONF = cfg.CONF
class AgentException(Exception):
@ -121,7 +123,9 @@ class Agent(murano_object.MuranoObject):
else:
return None
def call(self, template, resources, _context, timeout=600):
def call(self, template, resources, _context, timeout=None):
if timeout is None:
timeout = CONF.engine.agent_timeout
self._check_enabled()
plan = self.buildExecutionPlan(template, resources)
return self._send(plan, True, timeout, _context)
@ -131,7 +135,9 @@ class Agent(murano_object.MuranoObject):
plan = self.buildExecutionPlan(template, resources)
return self._send(plan, False, 0, _context)
def callRaw(self, plan, _context, timeout=600):
def callRaw(self, plan, _context, timeout=None):
if timeout is None:
timeout = CONF.engine.agent_timeout
self._check_enabled()
return self._send(plan, True, timeout, _context)