summaryrefslogtreecommitdiffstats
path: root/gitautodeploy/gitautodeploy.py
diff options
context:
space:
mode:
authorOliver Poignant <oliver@poignant.se>2016-04-10 01:50:47 +0200
committerOliver Poignant <oliver@poignant.se>2016-04-10 01:50:47 +0200
commit88e25a0f6360ed8875d4ed4616518d285c05d597 (patch)
treeefccbf43d6787b17220232457242d14bfaf45bba /gitautodeploy/gitautodeploy.py
parent3787a23919726af12edbcbae2b71fa1e3cdacaaa (diff)
downloadGit-Auto-Deploy-88e25a0f6360ed8875d4ed4616518d285c05d597.zip
Git-Auto-Deploy-88e25a0f6360ed8875d4ed4616518d285c05d597.tar.gz
Git-Auto-Deploy-88e25a0f6360ed8875d4ed4616518d285c05d597.tar.bz2
Fixed issue with config hierarchy
Diffstat (limited to 'gitautodeploy/gitautodeploy.py')
-rw-r--r--gitautodeploy/gitautodeploy.py28
1 files changed, 19 insertions, 9 deletions
diff --git a/gitautodeploy/gitautodeploy.py b/gitautodeploy/gitautodeploy.py
index c4f7ed8..a48c195 100644
--- a/gitautodeploy/gitautodeploy.py
+++ b/gitautodeploy/gitautodeploy.py
@@ -410,22 +410,22 @@ class GitAutoDeploy(object):
parser.add_argument("--pid-file",
help="specify a custom pid file",
- default=default_pid_file_value,
+ #default=default_pid_file_value,
type=str)
parser.add_argument("--log-file",
help="specify a log file",
- default=default_log_file_value,
+ #default=default_log_file_value,
type=str)
parser.add_argument("--host",
help="address to bind to",
- default=default_host_value,
+ #default=default_host_value,
type=str)
parser.add_argument("--port",
help="port to bind to",
- default=default_port_value,
+ #default=default_port_value,
type=int)
parser.add_argument("--ssl",
@@ -472,19 +472,29 @@ class GitAutoDeploy(object):
logger.info('No configuration file found or specified. Using default values.')
config_data = {}
- # Configuration options coming from environment or command line will
- # override those coming from config file
+ # Pid file config
if args.pid_file:
config_data['pidfilepath'] = args.pid_file
+ elif not 'pidfilepath' in config_data:
+ config_data['pidfilepath'] = default_pid_file_value
+ # Log file config
if args.log_file:
config_data['logfilepath'] = args.log_file
+ elif not 'logfilepath' in config_data:
+ config_data['logfilepath'] = default_log_file_value
- if args.host:
- config_data['host'] = args.host
-
+ # Port config
if args.port:
config_data['port'] = args.port
+ elif not 'port' in config_data:
+ config_data['port'] = default_port_value
+
+ # Host config
+ if args.host:
+ config_data['host'] = args.host
+ elif not 'host' in config_data:
+ config_data['host'] = default_host_value
# Extend config data with any repository defined by environment variables
config_data = self.read_repo_config_from_environment(config_data)