User configuration was ignored when a config was found in the same directory as the executable (we also call it the 'gitconfig').
This patch makes lnst-ctl read user configuration everytime. So we don't have to modify the 'gitconfig' directly, but use the user configuration instead.
Signed-off-by: Radek Pazdera rpazdera@redhat.com --- lnst-ctl | 17 +++++++++-------- 1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/lnst-ctl b/lnst-ctl index 8504ae1..c15e9af 100755 --- a/lnst-ctl +++ b/lnst-ctl @@ -101,14 +101,15 @@ def main(): config.load_config(gitcfg) else: config.load_config('/etc/lnst-ctl.conf') - usr_cfg = os.path.expanduser('~/.lnst/lnst-ctl.conf') - if os.path.isfile(usr_cfg): - config.load_config(usr_cfg) - else: - if not os.path.isdir(os.path.dirname(usr_cfg)): - os.makedirs(os.path.dirname(usr_cfg)) - with open(usr_cfg, 'w') as f: - f.write(config.dump_config()) + + usr_cfg = os.path.expanduser('~/.lnst/lnst-ctl.conf') + if os.path.isfile(usr_cfg): + config.load_config(usr_cfg) + else: + if not os.path.isdir(os.path.dirname(usr_cfg)): + os.makedirs(os.path.dirname(usr_cfg)) + with open(usr_cfg, 'w') as f: + f.write(config.dump_config())
debug = 0
lnst-developers@lists.fedorahosted.org