Remove unneeded try..except in heartbeat

as callback_url is now a required argument for this method,
there's no need for such check (presumably copy-pasted from
heartbeat-as-vendor-interface).

Besides, assigning a value to dictionary key never raises KeyError.

The now deprecated vendor heartbeat is unchanged.

Change-Id: Id1e1a15b2cbc5dfbae9655b0edbc30c0a0cf2c57
This commit is contained in:
Pavlo Shchelokovskyy 2016-09-23 16:19:39 +03:00
parent 96d7840109
commit cddb0be85f

View File

@ -457,12 +457,7 @@ class AgentDeployMixin(object):
{'node': node.uuid,
'heartbeat': driver_internal_info.get('agent_last_heartbeat')})
driver_internal_info['agent_last_heartbeat'] = int(time.time())
try:
driver_internal_info['agent_url'] = callback_url
except KeyError:
raise exception.MissingParameterValue(_('For heartbeat operation, '
'"agent_url" must be '
'specified.'))
driver_internal_info['agent_url'] = callback_url
node.driver_internal_info = driver_internal_info
node.save()