From patchwork Wed Oct 11 00:55:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonatan Schlag X-Patchwork-Id: 1452 Return-Path: Received: from mail01.ipfire.org (unknown [172.28.1.200]) by web02.ipfire.org (Postfix) with ESMTP id 1693D60BCF for ; Tue, 10 Oct 2017 15:55:31 +0200 (CEST) Received: from mail01.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id 182C62838; Tue, 10 Oct 2017 15:55:30 +0200 (CEST) Received: from bockland.local.familyschlag (unknown [10.172.1.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPSA id 39D5D2837; Tue, 10 Oct 2017 15:55:28 +0200 (CEST) From: Jonatan Schlag To: pakfire@lists.ipfire.org Subject: [PATCH 1/3] Load configurations only if the config file exists Date: Tue, 10 Oct 2017 15:55:23 +0200 Message-Id: <20171010135525.1102-1-jonatan.schlag@ipfire.org> X-Mailer: git-send-email 2.11.0 X-BeenThere: pakfire@lists.ipfire.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Mailinglist for the Pakfire Build System." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: pakfire-bounces@lists.ipfire.org Sender: "Pakfire" Signed-off-by: Jonatan Schlag --- src/buildservice/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/buildservice/__init__.py b/src/buildservice/__init__.py index be81ba0..9619bfe 100644 --- a/src/buildservice/__init__.py +++ b/src/buildservice/__init__.py @@ -84,8 +84,11 @@ class Backend(object): # Load all configuration files for path in paths: - log.debug("Loading configuration from %s" % path) - c.read(path) + if os.path.exists(path): + log.debug("Loading configuration from %s" % path) + c.read(path) + else: + log.error("No such file %s" % path) return c