From patchwork Wed Oct 11 00:55:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonatan Schlag X-Patchwork-Id: 1454 Return-Path: Received: from mail01.ipfire.org (unknown [172.28.1.200]) by web02.ipfire.org (Postfix) with ESMTP id 3DAF860BCF for ; Tue, 10 Oct 2017 15:55:34 +0200 (CEST) Received: from mail01.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id 10E2529F5; Tue, 10 Oct 2017 15:55:34 +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 363712872; Tue, 10 Oct 2017 15:55:32 +0200 (CEST) From: Jonatan Schlag To: pakfire@lists.ipfire.org Subject: [PATCH 3/3] The config now also passed as environment variables. Date: Tue, 10 Oct 2017 15:55:25 +0200 Message-Id: <20171010135525.1102-3-jonatan.schlag@ipfire.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171010135525.1102-1-jonatan.schlag@ipfire.org> References: <20171010135525.1102-1-jonatan.schlag@ipfire.org> 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/buildservice/__init__.py b/src/buildservice/__init__.py index 7a744f5..b9f3e65 100644 --- a/src/buildservice/__init__.py +++ b/src/buildservice/__init__.py @@ -74,6 +74,12 @@ class Backend(object): def read_config(self, path): c = ConfigParser.SafeConfigParser() + c.add_section("database") + c.set("database", "name", os.environ.get("PBS_DATABASE_NAME")) + c.set("database", "hostname", os.environ.get("PBS_DATABASE_HOSTNAME")) + c.set("database", "user", os.environ.get("PBS_DATABASE_USER")) + c.set("database", "password", os.environ.get("PBS_DATABASE_PASSWORD")) + # Load default configuration file first paths = [ os.path.join(CONFIGSDIR, "pbs.conf"),