Dan Kenigsberg has posted comments on this change.

Change subject: utils: allow retry of multiple functions
......................................................................


Patch Set 1: Code-Review-1

(1 comment)

http://gerrit.ovirt.org/#/c/36336/1/lib/vdsm/utils.py
File lib/vdsm/utils.py:

Line 933:         tries -= 1
Line 934:         try:
Line 935:             for func in funcs:
Line 936:                 res = func()
Line 937:             return res
this makes very little sense to me - you ignore the returned value of all but 
the last function. If an exception is raised, you cannot tell when it was.

A user can easily write a wrapper function that calls the funcs serialy, and 
pass it to retry.

And most users need to pass a single function anyway.
Line 938:         except expectedException:
Line 939:             if tries == 0:
Line 940:                 raise
Line 941: 


-- 
To view, visit http://gerrit.ovirt.org/36336
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I6c805ef33b710fbbe674ac62ae96c3fdf47423e1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Dima Kuznetsov <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to