summaryrefslogtreecommitdiff
path: root/rest_example.py
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@sonymobile.com>2013-10-17 16:59:06 +0900
committerDavid Pursehouse <david.pursehouse@sonymobile.com>2013-10-18 09:21:22 +0900
commit626b04ef841aa887909f03ea06d4e4ced38c9164 (patch)
tree963af35f2a367d6794e700e1d52c09dae199096a /rest_example.py
parent4289ec6b102447520e400cbc7941f2ceff11fe84 (diff)
downloadpygerrit-626b04ef841aa887909f03ea06d4e4ced38c9164.tar.gz
Fix pylint error in rest_example.py
pylint says: "redefinition of unused 'HTTPKerberosAuth' from line 34" Change-Id: Ie2b8cee42bf08eaa0e9bdab1ef5bf2b23ccee7f5
Diffstat (limited to 'rest_example.py')
-rwxr-xr-xrest_example.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/rest_example.py b/rest_example.py
index ad762fd..1c278c8 100755
--- a/rest_example.py
+++ b/rest_example.py
@@ -32,8 +32,9 @@ import sys
from requests.auth import HTTPBasicAuth, HTTPDigestAuth
try:
from requests_kerberos import HTTPKerberosAuth, OPTIONAL
+ _kerberos_support = True
except ImportError:
- HTTPKerberosAuth = None
+ _kerberos_support = False
from pygerrit.rest import GerritRestAPI
from pygerrit.rest.auth import HTTPDigestAuthFromNetrc, HTTPBasicAuthFromNetrc
@@ -72,7 +73,7 @@ def _main():
if not options.gerrit_url:
parser.error("Must specify Gerrit URL with --gerrit-url")
- if HTTPKerberosAuth and options.kerberos_auth:
+ if _kerberos_support and options.kerberos_auth:
if options.username or options.password \
or options.basic_auth or options.netrc:
parser.error("--kerberos-auth may not be used together with "