mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-04 19:56:32 +02:00
build_library: detach after every losetup succeeded
To avoid issues with losetup not being cleaned up, we need to call losetup --detach inside the retry loop.
This commit is contained in:
parent
a8cafdb31c
commit
518f12983f
@ -447,11 +447,10 @@ def PartitionLoop(options, partition):
|
||||
except:
|
||||
attempts += 1
|
||||
time.sleep(1)
|
||||
finally:
|
||||
Sudo(['losetup', '--detach', loop_dev])
|
||||
|
||||
try:
|
||||
yield loop_dev
|
||||
finally:
|
||||
Sudo(['losetup', '--detach', loop_dev])
|
||||
yield loop_dev
|
||||
|
||||
def FormatPartition(options, part):
|
||||
print "Formatting partition %s (%s) as %s" % (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user