This is an automated email from the git hooks/post-receive script.
nsoffer pushed a commit to branch master
in repository sanlock.
The following commit(s) were added to refs/heads/master by this push:
new 800a22d tests: Remove stale symlinks before linking loop device
800a22d is described below
commit 800a22d37ec4420d5e0757a80fbb551075a981ab
Author: Amit Bawer <abawer(a)redhat.com>
AuthorDate: Tue May 28 20:50:13 2019 +0300
tests: Remove stale symlinks before linking loop device
On storage setup we can have stale symlinks to loop devices
which were created before reboot and now are gone. Re-running the
setup will fail on creating the symlink again. In this patch we
add removal of the stale symlink, if there is such, before symlinking
the new loop device.
Signed-off-by: Amit Bawer <abawer(a)redhat.com>
---
tests/storage.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/storage.py b/tests/storage.py
index 3258ed4..b7fcb2a 100644
--- a/tests/storage.py
+++ b/tests/storage.py
@@ -84,6 +84,10 @@ def create_loop_device(link_path, backing_file, size=1024**3,
device = out.decode("utf-8").strip()
+ # Remove stale symlink.
+ if os.path.islink(link_path):
+ os.unlink(link_path)
+
os.symlink(device, link_path)
chown(link_path)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date