From f3efe0cd63575525efff3199b6dace4cc592923a Mon Sep 17 00:00:00 2001
From: David Douard <david.douard@sdfa3.org>
Date: Thu, 24 Jan 2019 10:55:55 +0100
Subject: [PATCH] Allow to override config file name via the
 SWH_CONFIG_FILENAME env var

this will take precedence over the implicit config file scheme.

Related to T1410 and T826
---
 swh/core/config.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/swh/core/config.py b/swh/core/config.py
index ac0ac4d4..b2583114 100644
--- a/swh/core/config.py
+++ b/swh/core/config.py
@@ -338,6 +338,8 @@ class SWHConfig:
 
         if config_filename:
             config_filenames = [config_filename]
+        elif 'SWH_CONFIG_FILENAME' in os.environ:
+            config_filenames = [os.environ['SWH_CONFIG_FILENAME']]
         else:
             if not base_filename:
                 base_filename = cls.CONFIG_BASE_FILENAME
-- 
GitLab