Skip to content

Commit

Permalink
Merge pull request #103 from milo-minderbinder/master
Browse files Browse the repository at this point in the history
Minor jirashell fixes - #100, #102, #66, and tweaks for d585674
  • Loading branch information
ssbarnea committed Aug 4, 2015
2 parents 0f33f03 + 1425bb8 commit d32d50b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions jira/jirashell.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ def process_config():
basic_auth = {}

if parser.has_section('oauth'):
oauth = dict(parser.items('oauth'))
oauth = {}
for option, value in parser.items('oauth'):
if option in ("oauth_dance", "print_tokens"):
value = parser.getboolean('oauth', option)
oauth[option] = value
else:
oauth = {}

Expand Down Expand Up @@ -239,10 +243,11 @@ def main():
if basic_auth:
basic_auth = (basic_auth['username'], basic_auth['password'])

if 'oauth_dance' in oauth and oauth['oauth_dance']:
if oauth.get('oauth_dance') is True:
oauth = oauth_dance(
options['server'], oauth['consumer_key'], oauth['key_cert'], oauth['print_tokens'], options['verify'])
else:
elif not all((oauth.get('access_token'), oauth.get('access_token_secret'),
oauth.get('consumer_key'), oauth.get('key_cert'))):
oauth = None

jira = JIRA(options=options, basic_auth=basic_auth, oauth=oauth)
Expand Down

0 comments on commit d32d50b

Please sign in to comment.