Re: [PATCH lorax/master 2/6] pylorax.imgutils: add retry loop and "lazy" to umount()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:\n%s\n", 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)

Attachment: pgpt6C6b0LKaC.pgp
Description: PGP signature

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux