From fcd2060e8efff83b7bdef04323077f87e011fdc4 Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Thu, 13 Jun 2019 09:07:16 -0400 Subject: 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 Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-Id: <20190613130718.3763-3-crosa@redhat.com> Signed-off-by: Alex Bennée --- tests/vm/freebsd | 2 -- 1 file changed, 2 deletions(-) (limited to 'tests/vm/freebsd') diff --git a/tests/vm/freebsd b/tests/vm/freebsd index 5575c23a6f..091be1a065 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__": -- cgit v1.2.3-55-g7522