Revision 6c78720b snf-tools/synnefo_tools/burnin/logger.py

b/snf-tools/synnefo_tools/burnin/logger.py
99 99

  
100 100
def _format_message(msg, *args):
101 101
    """Format the message using the args"""
102
    return (msg % args) + "\n"
102
    if args:
103
        return (msg % args) + "\n"
104
    else:
105
        return msg + "\n"
103 106

  
104 107

  
105 108
def _list_to_string(lst, append=""):
......
439 442
        """
440 443
        if self.use_colors:
441 444
            if callable(color_fun):
442
                return color_fun((msg % args)) + "\n"
445
                if args:
446
                    return color_fun((msg % args)) + "\n"
447
                else:
448
                    return color_fun(msg) + "\n"
443 449
            else:
444 450
                args = tuple([_blue(arg) for arg in args])
445 451
                return _format_message(msg, *args)

Also available in: Unified diff