Change in vdsm[master]: utils: Add @throttle decorator
mbetak at redhat.com
mbetak at redhat.com
Fri Oct 16 15:17:08 UTC 2015
Martin Betak has posted comments on this change.
Change subject: utils: Add @throttle decorator
......................................................................
Patch Set 5:
(2 comments)
https://gerrit.ovirt.org/#/c/47087/5/tests/vmUtilsTests.py
File tests/vmUtilsTests.py:
Line 149: class MockSemaphore(object):
Line 150:
Line 151: def __init__(self, initial=1):
Line 152: self.counter = initial
Line 153: self.acquireCalled = False
> please check if @recorded decorator can help you here
thanks, this is exactly what I needed!
Line 154: self.releaseCalled = False
Line 155:
Line 156: def acquire(self, block=True):
Line 157: self.acquireCalled = True
https://gerrit.ovirt.org/#/c/47087/5/vdsm/virt/utils.py
File vdsm/virt/utils.py:
Line 120: rmFile(os.path.realpath(sock))
Line 121: rmFile(sock)
Line 122:
Line 123:
Line 124: def throttle(semaphore, block=True, err=None):
> Please either point me to the case for supporting block=True, or let's drop
Done
Line 125: """
Line 126: Helper decorator for API methods that should have limited number
Line 127: of concurrent executions.
Line 128:
--
To view, visit https://gerrit.ovirt.org/47087
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iab4cf387f77a9b720afb7794e27ed54efa0d3e3c
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Betak <mbetak at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Betak <mbetak at redhat.com>
Gerrit-Reviewer: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: Vinzenz Feenstra <vfeenstr at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list