aboutsummaryrefslogtreecommitdiff
path: root/tests/vm/freebsd
diff options
context:
space:
mode:
authorCleber Rosa <crosa@redhat.com>2019-06-13 09:07:16 -0400
committerAlex Bennée <alex.bennee@linaro.org>2019-07-04 19:22:58 +0100
commitfcd2060e8efff83b7bdef04323077f87e011fdc4 (patch)
treeac49becc308c34193731a232a2868551d1654eb1 /tests/vm/freebsd
parent676d1f3e2f4667ead88cb719db0581f396fc60bf (diff)
downloadqemu-fcd2060e8efff83b7bdef04323077f87e011fdc4.zip
qemu-fcd2060e8efff83b7bdef04323077f87e011fdc4.tar.gz
qemu-fcd2060e8efff83b7bdef04323077f87e011fdc4.tar.bz2
tests/vm: avoid image presence check and removal
Python's os.rename() will silently replace an existing file, so there's no need for the extra check and removal. Reference: https://docs.python.org/3/library/os.html#os.rename Signed-off-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20190613130718.3763-3-crosa@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Diffstat (limited to 'tests/vm/freebsd')
-rwxr-xr-xtests/vm/freebsd2
1 files changed, 0 insertions, 2 deletions
diff --git a/tests/vm/freebsd b/tests/vm/freebsd
index 5575c23..091be1a 100755
--- a/tests/vm/freebsd
+++ b/tests/vm/freebsd
@@ -36,8 +36,6 @@ class FreeBSDVM(basevm.BaseVM):
sys.stderr.write("Extracting the image...\n")
subprocess.check_call(["ln", "-f", cimg, img_tmp_xz])
subprocess.check_call(["xz", "--keep", "-dvf", img_tmp_xz])
- if os.path.exists(img):
- os.remove(img)
os.rename(img_tmp, img)
if __name__ == "__main__":