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

Commit

Permalink
config: Fix the config to pick local if needed
Browse files Browse the repository at this point in the history
Signed-off-by: Sayan Chowdhury <sayan.chowdhury2012@gmail.com>
  • Loading branch information
sayanchowdhury committed Jul 25, 2018
1 parent 460be30 commit 126e4ea
Showing 1 changed file with 8 additions and 1 deletion.
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

0 comments on commit 126e4ea

Please sign in to comment.