Add more logging for software deployment updates

Include the server ID in existing logs, and add additional logs that will
let us know when updates to software deployments have happened and whether
they have succeeded or not. This should save considerable time
investigating in the future if there's ever any question of whether a
deployment has gone missing in Heat itself or somewhere on the target
server.

Change-Id: I33d7aee5974d03b7e41beab9fef4ad643cb0c469
changes/31/522031/1
Zane Bitter 5 years ago
parent 90e8060480
commit 34d592b622
  1. 19
      heat/engine/service_software_config.py

@ -123,22 +123,33 @@ class SoftwareConfigService(object):
if etag:
metadata_headers = {'if-match': etag}
else:
LOG.warning('Couldn\'t find existing Swift metadata')
LOG.warning("Couldn't find existing Swift metadata "
"for server %s", server_id)
rows_updated = db_api.resource_update(
cnxt, rs.id, {'rsrc_metadata': md}, rs.atomic_key)
if not rows_updated:
LOG.debug('Conflict on database deployment update, retrying')
LOG.debug('Conflict on deployment metadata update for '
'server %s; retrying', server_id)
action = _('deployments of server %s') % server_id
raise exception.ConcurrentTransaction(action=action)
LOG.debug('Updated deployment metadata for server %s', server_id)
if metadata_put_url:
json_md = jsonutils.dumps(md)
resp = requests.put(metadata_put_url, json_md,
headers=metadata_headers)
if resp.status_code == 412:
LOG.debug('Conflict on Swift deployment update, retrying')
if resp.status_code == requests.codes.precondition_failed:
LOG.debug('Conflict on Swift deployment update for '
'server %s; retrying', server_id)
action = _('deployments of server %s') % server_id
raise exception.ConcurrentTransaction(action=action)
else:
try:
resp.raise_for_status()
except requests.HTTPError as exc:
LOG.error('Failed to deliver deployment data to '
'server %s: %s', server_id, exc)
if metadata_queue_id:
project = stack_user_project_id
queue = self._get_zaqar_queue(cnxt, rs, project, metadata_queue_id)

Loading…
Cancel
Save