FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 06-20-2012, 04:13 PM
"Brian C. Lane"
 
Default pylorax.imgutils: add retry loop and "lazy" to umount()

On Tue, Jun 19, 2012 at 08:11:25PM -0400, Will Woods wrote:
> + count = 0
> + while maxretry > 0:
> + try:
> + rv = check_call(umount)
> + except CalledProcessError:
> + count += 1
> + if count == maxretry:
> + raise
> + logger.warn("failed to unmount %s. retrying (%d/%d)...",
> + mnt, count, maxretry)
> + if logger.getEffectiveLevel() <= logging.DEBUG:
> + fuser = check_output(["fuser", "-vm", mnt],
> + stderr=STDOUT)
> + logger.debug("fuser -vm:
%s
", fuser)
> + sleep(retrysleep)
> + else:
> + break

The loop condition is a bit odd, since maxretry is never updated. It
looks like it will work fine, but might be clearer if it was just a
'while True' or 'while count < maxretry'

--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 11:35 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org