Merge "Remove utils.timefunc function"
This commit is contained in:
@@ -33,7 +33,6 @@ import socket
|
|||||||
import struct
|
import struct
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
import time
|
|
||||||
from xml.sax import saxutils
|
from xml.sax import saxutils
|
||||||
|
|
||||||
import eventlet
|
import eventlet
|
||||||
@@ -646,20 +645,6 @@ def convert_to_list_dict(lst, label):
|
|||||||
return [{label: x} for x in lst]
|
return [{label: x} for x in lst]
|
||||||
|
|
||||||
|
|
||||||
def timefunc(func):
|
|
||||||
"""Decorator that logs how long a particular function took to execute."""
|
|
||||||
@functools.wraps(func)
|
|
||||||
def inner(*args, **kwargs):
|
|
||||||
start_time = time.time()
|
|
||||||
try:
|
|
||||||
return func(*args, **kwargs)
|
|
||||||
finally:
|
|
||||||
total_time = time.time() - start_time
|
|
||||||
LOG.debug(_("timefunc: '%(name)s' took %(total_time).2f secs") %
|
|
||||||
dict(name=func.__name__, total_time=total_time))
|
|
||||||
return inner
|
|
||||||
|
|
||||||
|
|
||||||
def make_dev_path(dev, partition=None, base='/dev'):
|
def make_dev_path(dev, partition=None, base='/dev'):
|
||||||
"""Return a path to a particular device.
|
"""Return a path to a particular device.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user