Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PILOTVERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.11.3.9
3.11.4.1
4 changes: 2 additions & 2 deletions pilot/util/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
# Pilot version
RELEASE = '3' # released number should be fixed at 3 for Pilot 3
VERSION = '11' # version number is '1' for first release, '0' until then, increased for bigger updates
REVISION = '3' # revision number should be reset to '0' for every new version release, increased for small updates
BUILD = '9' # build number should be reset to '1' for every new development cycle
REVISION = '4' # revision number should be reset to '0' for every new version release, increased for small updates
BUILD = '1' # build number should be reset to '1' for every new development cycle

SUCCESS = 0
FAILURE = 1
Expand Down
21 changes: 20 additions & 1 deletion pilot/util/https.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@
sleep,
time
)
from typing import Any
from typing import (
Any,
Optional
)
from urllib.parse import parse_qs

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

return resource_types


def extract_protocol(url: str) -> Optional[str]:
"""Extract the protocol (scheme) from a URL.

This function uses ``urllib.parse.urlparse`` to safely parse the URL
and return its scheme component (e.g. ``http``, ``https``, ``root``).

Args:
url: The URL string to parse.

Returns:
The protocol (scheme) if present, otherwise ``None``.
"""
parsed = urllib.parse.urlparse(url)
return parsed.scheme or None
11 changes: 9 additions & 2 deletions pilot/util/tracereport.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@
append_to_file,
write_file
)
from pilot.util.https import request2

from pilot.util.https import (
extract_protocol,
request2
)
logger = logging.getLogger(__name__)


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

url = config.Rucio.url
logger.info(f"tracing server: {url}")

# determine protocol in case it is not set (to prevent None values sent to server)
if not self['protocol'] and self['url']:
self['protocol'] = extract_protocol(self['url'])
logger.debug(f'setting protocol to {self["protocol"]}')
logger.info(f"sending tracing report: {self}")

if not self.verify_trace():
Expand Down