uskudnik / amazon-glacier-cmd-interface

Command line interface for Amazon Glacier
MIT License
374 stars 100 forks source link

Reading configuration - wrong order. #39

Closed wvmarle closed 12 years ago

wvmarle commented 12 years ago

Another issue spotted in reading the configuration:

glacier.py:545

if config.read([args.conf, os.path.expanduser('~/.glacier')]):

ConfigParser.read() priority is low to high, meaning the command line is overridden by the config file. That's not correct behaviour, command line options should override the configuration file.

Also I want to suggest adding a system wide configuration file, e.g. /etc/glacier.cfg where system defaults can be stored. This is great for people like me who call this script after finishing creating a backup (using bacula) to upload the backup archive to glacier.

Suggest changing glacier.py:545 to:

if config.read(['/etc/glacier.cfg', os.path.expanduser('~/.glacier'), args.conf]):

What this should do now:

offlinehacker commented 12 years ago

I will fix this, but why don't you make pull request?

wvmarle commented 12 years ago

New to Github; haven't figured it all out yet!

offlinehacker commented 12 years ago

Okay no problem, will fix this and add support for global config file.

wvmarle commented 12 years ago

Resolved; closing.