Print uid with log to facilitate log tracking

Change-Id: I371ebae572042688934f51524df888be1a468bf4
Signed-off-by: Nayan Deshmukh <n.deshmukh@samsung.com>
This commit is contained in:
Nayan Deshmukh 2019-07-17 10:54:50 +09:00
parent 1e11b11d50
commit b3d808fb80
2 changed files with 10 additions and 4 deletions

View File

@ -186,12 +186,16 @@ class VIFHandler(k8s_base.ResourceEventHandler):
def _set_pod_state(self, pod, state):
# TODO(ivc): extract annotation interactions
if not state:
LOG.debug("Removing VIFs annotation: %r", state)
LOG.debug("Removing VIFs annotation: %r for pod %s/%s (uid: %s)",
state, pod['metadata']['namespace'],
pod['metadata']['name'], pod['metadata']['uid'])
annotation = None
else:
state_dict = state.obj_to_primitive()
annotation = jsonutils.dumps(state_dict, sort_keys=True)
LOG.debug("Setting VIFs annotation: %r", annotation)
LOG.debug("Setting VIFs annotation: %r for pod %s/%s (uid: %s)",
annotation, pod['metadata']['namespace'],
pod['metadata']['name'], pod['metadata']['uid'])
labels = pod['metadata'].get('labels')
if not labels:

View File

@ -62,8 +62,10 @@ class Dispatcher(h_base.EventHandler):
obj = event.get('object', {})
obj_meta = obj.get('metadata', {})
LOG.debug("%d handler(s) available for event %s %s:%s", len(handlers),
event.get('type'), obj.get('kind'), obj_meta.get('name'))
LOG.debug("%d handler(s) available for event %s %s:%s/%s (uid: %s)",
len(handlers), event.get('type'), obj.get('kind'),
obj_meta.get('namespace'), obj_meta.get('name'),
obj_meta.get('uid'))
for handler in handlers:
handler(event)