Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

config: Fix the config to pick local if needed #150

Merged
merged 1 commit into from
Jul 25, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion fedimg/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,18 @@
# Authors: David Gay <dgay@redhat.com>
# Sayan Chowdhury <sayanchowdhury@fedoraproject.org>

import os.path
import toml

config_file = '/etc/fedimg/fedimg-conf.toml'
if not os.path.isfile(config_file):
# Get the path of the configuration file
project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
config_file = os.path.join(project_root, 'fedimg-conf.toml.example')

# Read in config file
config = {}
with open("/etc/fedimg/fedimg-conf.toml") as conffile:
with open(config_file) as conffile:
config = toml.loads(conffile.read())

# Fedimg Consumer configurations
Expand Down