Skip to content

Commit 501879f

Browse files
authored
Merge pull request #190 from PanDAWMS/next
3.11.4.1
2 parents 126508a + 5aaf363 commit 501879f

File tree

4 files changed

+32
-6
lines changed

4 files changed

+32
-6
lines changed

PILOTVERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.11.3.9
1+
3.11.4.1

pilot/util/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
# Pilot version
2828
RELEASE = '3' # released number should be fixed at 3 for Pilot 3
2929
VERSION = '11' # version number is '1' for first release, '0' until then, increased for bigger updates
30-
REVISION = '3' # revision number should be reset to '0' for every new version release, increased for small updates
31-
BUILD = '9' # build number should be reset to '1' for every new development cycle
30+
REVISION = '4' # revision number should be reset to '0' for every new version release, increased for small updates
31+
BUILD = '1' # build number should be reset to '1' for every new development cycle
3232

3333
SUCCESS = 0
3434
FAILURE = 1

pilot/util/https.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@
6161
sleep,
6262
time
6363
)
64-
from typing import Any
64+
from typing import (
65+
Any,
66+
Optional
67+
)
6568
from urllib.parse import parse_qs
6669

6770
from pilot.common.errorcodes import ErrorCodes
@@ -1375,3 +1378,19 @@ def get_memory_limits(url: str, port: int) -> dict:
13751378
resource_types = {}
13761379

13771380
return resource_types
1381+
1382+
1383+
def extract_protocol(url: str) -> Optional[str]:
1384+
"""Extract the protocol (scheme) from a URL.
1385+
1386+
This function uses ``urllib.parse.urlparse`` to safely parse the URL
1387+
and return its scheme component (e.g. ``http``, ``https``, ``root``).
1388+
1389+
Args:
1390+
url: The URL string to parse.
1391+
1392+
Returns:
1393+
The protocol (scheme) if present, otherwise ``None``.
1394+
"""
1395+
parsed = urllib.parse.urlparse(url)
1396+
return parsed.scheme or None

pilot/util/tracereport.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@
5454
append_to_file,
5555
write_file
5656
)
57-
from pilot.util.https import request2
58-
57+
from pilot.util.https import (
58+
extract_protocol,
59+
request2
60+
)
5961
logger = logging.getLogger(__name__)
6062

6163

@@ -201,6 +203,11 @@ def send(self) -> bool: # noqa: C901
201203

202204
url = config.Rucio.url
203205
logger.info(f"tracing server: {url}")
206+
207+
# determine protocol in case it is not set (to prevent None values sent to server)
208+
if not self['protocol'] and self['url']:
209+
self['protocol'] = extract_protocol(self['url'])
210+
logger.debug(f'setting protocol to {self["protocol"]}')
204211
logger.info(f"sending tracing report: {self}")
205212

206213
if not self.verify_trace():

0 commit comments

Comments
 (0)