From 2545248c4a7b836c90da2814b00de645c38ce362 Mon Sep 17 00:00:00 2001 From: Lukas Holecek Date: Nov 21 2019 11:29:46 +0000 Subject: Fix installing subject types Installing subject types to "/etc/greenwave" breaks existing OpenShift templates which remount the configuration directory with custom files. This instead installs the files in Python module under "conf/subject_types" directory. The path to this directory can still be overridden with `SUBJECT_TYPES_DIR` option. JIRA: FACTORY-5574 Signed-off-by: Lukas Holecek --- diff --git a/greenwave/config.py b/greenwave/config.py index 5de8976..aa372df 100644 --- a/greenwave/config.py +++ b/greenwave/config.py @@ -31,7 +31,7 @@ class Config(object): REQUESTS_VERIFY = True POLICIES_DIR = '/etc/greenwave/policies' - SUBJECT_TYPES_DIR = '/etc/greenwave/subject_types' + SUBJECT_TYPES_DIR = _local_conf_dir('subject_types') MESSAGING = 'fedmsg' @@ -53,7 +53,6 @@ class DevelopmentConfig(Config): WAIVERDB_API_URL = 'http://localhost:5004/api/v1.0' GREENWAVE_API_URL = 'http://localhost:5005/api/v1.0' POLICIES_DIR = _local_conf_dir('policies') - SUBJECT_TYPES_DIR = _local_conf_dir('subject_types') class TestingConfig(Config): @@ -62,4 +61,3 @@ class TestingConfig(Config): GREENWAVE_API_URL = 'http://localhost:5005/api/v1.0' KOJI_BASE_URL = 'http://localhost:5006/kojihub' POLICIES_DIR = _local_conf_dir('policies') - SUBJECT_TYPES_DIR = _local_conf_dir('subject_types') diff --git a/setup.py b/setup.py index fec2325..81a57a3 100644 --- a/setup.py +++ b/setup.py @@ -101,6 +101,6 @@ setup( """, data_files=[ ('/etc/fedmsg.d/', ['fedmsg.d/resultsdb.py', 'fedmsg.d/waiverdb.py']), - ('/etc/greenwave/subject_types/', glob.glob('conf/subject_types/*')), + ('conf/subject_types/', glob.glob('conf/subject_types/*')), ] )