Hello Friends,

I  need suggestion on the if statement in the below code  , all that I was
trying to do was to add a check  i.e if any one of the functions return
True then  break the loop.


 end_time = time.time() + 300
    umount_completed = False
    while time.time() < end_time:
        if attempt_umount() is True or df_output_lines() is True:
           logging.info("umount completed sucessfully")
           umount_completed = True
           break
        time.sleep(15)
    assert umount_completed, "ERROR: The umount failed Exiting"

Can this be optimized better  , please suggest.  I am on Linux and Python
2.7


Regards.
Ganesh
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to