MR http://gitlab.cloudforms.lab.eng.rdu2.redhat.com/cloudforms/cfme/merge_requests/554 Fix Ported to 5.4
*** Bug 1286863 has been marked as a duplicate of this bug. ***
Fixed and verified in 5.4.5.0.20160120124945_d8bf7e3. Using this manual https://pemcg.gitbooks.io/introduction-to-cloudforms-automation/content/chapter2/writing_and_running_our_own_scripts.html I ran the attached script 10 times with "loops = [1,2,3,4]" and there were no errors.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2016-0171.html