Skip to content

Commit

Permalink
fixup pylint
Browse files Browse the repository at this point in the history
Signed-off-by: Gang Ji <[email protected]>
  • Loading branch information
gangj committed Nov 11, 2024
1 parent e131513 commit 3ff9d75
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions scripts/yum-plugins/accesstoken.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
# The content of the file referred by the <token-file-path> looks like:
# { 'token': '...', 'token_id': '...' }

import json
from yum import config
from yum.plugins import TYPE_CORE
import json
import urlgrabber


requires_api_version = '2.5'
plugin_type = (TYPE_CORE,)

def config_hook(conduit):
def config_hook(conduit): # pylint: disable=unused-argument
config.RepoConf.accesstoken = config.UrlOption()

def init_hook(conduit):
Expand All @@ -39,7 +39,7 @@ def init_hook(conduit):
continue

if not (token['token'] and token['token_id']):
raise Exception("Invalid token or token_id") #pylint: disable=broad-except
raise Exception("Invalid token or token_id") #pylint: disable=broad-exception-raised

repo.http_headers['X-Access-Token'] = str(token['token'])
repo.http_headers['Referer'] = str(token['token_id'])
4 changes: 2 additions & 2 deletions scripts/yum-plugins/xapitoken.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
# The content of the file referred by the <token-file-path> looks like:
# { 'xapitoken': '...' }

import json
from yum import config
from yum.plugins import TYPE_CORE
import json
import urlgrabber


Expand All @@ -39,7 +39,7 @@ def init_hook(conduit):
continue

if not token['xapitoken']:
raise Exception("Invalid xapitoken") #pylint: disable=broad-except
raise Exception("Invalid xapitoken") #pylint: disable=broad-exception-raised

# Only include the xapitoken for repos with a localhost URL, for added safety.
# These will be proxied to the remote pool coordinator through stunnel, set up by xapi.
Expand Down

0 comments on commit 3ff9d75

Please sign in to comment.