This was resulting in exceptions beeing thrown with a command as simple as:
`copr_cli list pingou`
---
copr_cli/subcommands.py | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/copr_cli/subcommands.py b/copr_cli/subcommands.py
index 56b2d6d..dc2ddb0 100644
--- a/copr_cli/subcommands.py
+++ b/copr_cli/subcommands.py
@@ -33,11 +33,15 @@ def get_user():
def get_api_url():
""" Retrieve the user information from the config file.
"""
- config = ConfigParser.ConfigParser(
- {'copr_url': 'http://copr-fe.cloud.fedoraproject.org'})
- config.read(os.path.join(os.path.expanduser('~'), '.config',
- 'copr'))
- copr_url = config.get('copr-cli', 'copr_url')
+ config = ConfigParser.ConfigParser()
+ config.read(
+ os.path.join(os.path.expanduser('~'), '.config', 'copr')
+ )
+
+ # Default copr_url:
+ copr_url = 'http://copr-fe.cloud.fedoraproject.org/'
+ if config.has_section('copr-cli'):
+ copr_url = config.get('copr-cli', 'copr_url')
return '%s/api' % copr_url
--
1.8.3.1