{"id":807724,"url":"http://patchwork.ozlabs.org/api/1.0/patches/807724/?format=json","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/1.0/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<aea3a5d63b6937d8bd87afb3741db6c09ea7436e.1504111803.git.jcody@redhat.com>","date":"2017-08-30T16:52:45","name":"[v3,3/5] qemu-iotests: add 'blind_remove' for python tests","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"565b52b736ff5309038c590a091f49dc3764e19b","submitter":{"id":12159,"url":"http://patchwork.ozlabs.org/api/1.0/people/12159/?format=json","name":"Jeff Cody","email":"jcody@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/aea3a5d63b6937d8bd87afb3741db6c09ea7436e.1504111803.git.jcody@redhat.com/mbox/","series":[{"id":657,"url":"http://patchwork.ozlabs.org/api/1.0/series/657/?format=json","date":"2017-08-30T16:52:47","name":"qemu-iotests: place output in unique dir","version":3,"mbox":"http://patchwork.ozlabs.org/series/657/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/807724/checks/","tags":{},"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com","ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=jcody@redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xjBSj1bSJz9sQl\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 31 Aug 2017 02:55:01 +1000 (AEST)","from localhost ([::1]:51617 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dn6GY-0002GG-Rp\n\tfor incoming@patchwork.ozlabs.org; Wed, 30 Aug 2017 12:54:58 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:56248)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <jcody@redhat.com>) id 1dn6Ei-0001CH-2Q\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 12:53:04 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <jcody@redhat.com>) id 1dn6Eh-0004uE-97\n\tfor qemu-devel@nongnu.org; Wed, 30 Aug 2017 12:53:04 -0400","from mx1.redhat.com ([209.132.183.28]:34386)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <jcody@redhat.com>)\n\tid 1dn6Ef-0004sN-9R; Wed, 30 Aug 2017 12:53:01 -0400","from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 36EE35D5EA;\n\tWed, 30 Aug 2017 16:53:00 +0000 (UTC)","from localhost (ovpn-116-70.phx2.redhat.com [10.3.116.70])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 044C28D573;\n\tWed, 30 Aug 2017 16:52:59 +0000 (UTC)"],"DMARC-Filter":"OpenDMARC Filter v1.3.2 mx1.redhat.com 36EE35D5EA","From":"Jeff Cody <jcody@redhat.com>","To":"qemu-devel@nongnu.org","Date":"Wed, 30 Aug 2017 12:52:45 -0400","Message-Id":"<aea3a5d63b6937d8bd87afb3741db6c09ea7436e.1504111803.git.jcody@redhat.com>","In-Reply-To":["<cover.1504111803.git.jcody@redhat.com>","<cover.1504111803.git.jcody@redhat.com>"],"References":["<cover.1504111803.git.jcody@redhat.com>","<cover.1504111803.git.jcody@redhat.com>"],"X-Scanned-By":"MIMEDefang 2.79 on 10.5.11.11","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.39]);\n\tWed, 30 Aug 2017 16:53:00 +0000 (UTC)","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]","X-Received-From":"209.132.183.28","Subject":"[Qemu-devel] [PATCH v3 3/5] qemu-iotests: add 'blind_remove' for\n\tpython tests","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"kwolf@redhat.com, qemu-block@nongnu.org, armbru@redhat.com,\n\tstefanha@redhat.com, jsnow@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"},"content":"Add a function to attempt to 'blindly' remove a file, without\nthrowing an error if the file doesn't exist.\n\nSigned-off-by: Jeff Cody <jcody@redhat.com>\n---\n tests/qemu-iotests/iotests.py | 7 +++++++\n 1 file changed, 7 insertions(+)","diff":"diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py\nindex 7233983..a2088c7 100644\n--- a/tests/qemu-iotests/iotests.py\n+++ b/tests/qemu-iotests/iotests.py\n@@ -57,6 +57,13 @@ qemu_default_machine = os.environ.get('QEMU_DEFAULT_MACHINE')\n socket_scm_helper = os.environ.get('SOCKET_SCM_HELPER', 'socket_scm_helper')\n debug = False\n \n+def blind_remove(filename):\n+    try:\n+        os.remove(filename)\n+    except OSError, error:\n+        if error.errno != errno.ENOENT:\n+            raise\n+\n def qemu_img(*args):\n     '''Run qemu-img and return the exit code'''\n     devnull = open('/dev/null', 'r+')\n","prefixes":["v3","3/5"]}