gitlab.lister: Do not expect gitlab instances to have credentials
Only the main gitlab.com instance supports a rate limit (thus the credentials need), others do not (as per summer 2018).
This commit is contained in:
parent
f72f2bc6ac
commit
ae514a84c4
1 changed files with 3 additions and 5 deletions
|
@ -59,11 +59,9 @@ class GitLabLister(PageByPageHttpLister):
|
|||
params = {
|
||||
'headers': self.request_headers() or {}
|
||||
}
|
||||
# Retrieve the credentials per instance
|
||||
creds = self.config['credentials']
|
||||
if creds:
|
||||
creds_lister = creds[self.instance]
|
||||
auth = random.choice(creds_lister) if creds else None
|
||||
creds_lister = self.config['credentials'].get(self.instance)
|
||||
if creds_lister:
|
||||
auth = random.choice(creds_lister)
|
||||
if auth:
|
||||
params['auth'] = (auth['username'], auth['password'])
|
||||
return params
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue