Revision cc92b70f snf-cyclades-app/synnefo/logic/callbacks.py

b/snf-cyclades-app/synnefo/logic/callbacks.py
41 41

  
42 42
log = logging.getLogger(__name__)
43 43

  
44

  
44 45
def handle_message_delivery(func):
45 46
    """ Generic decorator for handling messages.
46 47

  
......
145 146

  
146 147
        if db_time and event_time <= db_time:
147 148
            format_ = "%d/%m/%y %H:%M:%S:%f"
148
            log.debug("Ignoring message %s.\nevent_timestamp: %s db_timestamp: %s",
149
            log.debug("Ignoring message %s.\nevent_timestamp: %s"
150
                      " db_timestamp: %s",
149 151
                      msg,
150 152
                      event_time.strftime(format_),
151 153
                      db_time.strftime(format_))
......
246 248
    if msg['type'] == 'image-helper':
247 249
        # for helper task events join subtype to diagnostic source and
248 250
        # set task name as diagnostic message
249
        if msg.get('subtype', None) and msg.get('subtype') in ['task-start',
250
              'task-end']:
251
            message = msg.get('task', message)
252
            source = "%s-%s" % (source, msg.get('subtype'))
251
        if msg.get('subtype', None):
252
            if msg.get('subtype') in ['task-start', 'task-end']:
253
                message = msg.get('task', message)
254
                source = "%s-%s" % (source, msg.get('subtype'))
253 255

  
254 256
        if msg.get('subtype', None) == 'warning':
255 257
            level = 'WARNING'
......
271 273

  
272 274
    # create the diagnostic entry
273 275
    backend.create_instance_diagnostic(vm, message, source, level, event_time,
274
        details=details)
276
                                       details=details)
275 277

  
276 278
    log.debug("Done processing ganeti-create-progress msg for vm %s.",
277 279
              msg['instance'])

Also available in: Unified diff