Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7122872
D4938.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D4938.diff
View Options
diff --git a/swh/lister/bitbucket/lister.py b/swh/lister/bitbucket/lister.py
--- a/swh/lister/bitbucket/lister.py
+++ b/swh/lister/bitbucket/lister.py
@@ -6,6 +6,7 @@
from dataclasses import asdict, dataclass
from datetime import datetime
import logging
+import random
from typing import Any, Dict, Iterator, List, Optional
from urllib import parse
@@ -82,13 +83,11 @@
)
if len(self.credentials) > 0:
- if len(self.credentials) > 1:
- logger.warning(
- "Bitbucket lister support only one username:password"
- " pair as of now. Will use the first one."
- )
- cred = self.credentials[0]
+ cred = random.choice(self.credentials)
+ logger.warning("Using Bitbucket credentials from user %s", cred["username"])
self.set_credentials(cred["username"], cred["password"])
+ else:
+ logger.warning("No credentials set in configuration, using anonymous mode")
def state_from_dict(self, d: Dict[str, Any]) -> BitbucketListerState:
last_repo_cdate = d.get("last_repo_cdate")
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Dec 17 2024, 8:51 AM (13 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3216406
Attached To
D4938: bitbucket: Pick random credentials in configuration and improve logging
Event Timeline
Log In to Comment