MCPcopy Create free account
hub / github.com/bootc-dev/bootc / distro_requires_user_agent_support

Function distro_requires_user_agent_support

tmt/tests/booted/test-user-agent.py:67–86  ·  view source on GitHub ↗

Check if the current distro should have skopeo with --user-agent-prefix. Returns True if we're on a distro version that ships skopeo >= 1.21.0, meaning the test must not be skipped.

()

Source from the content-addressed store, hash-verified

65
66
67def distro_requires_user_agent_support() -> bool:
68 """Check if the current distro should have skopeo with --user-agent-prefix.
69
70 Returns True if we're on a distro version that ships skopeo >= 1.21.0,
71 meaning the test must not be skipped.
72 """
73 os_release = parse_os_release()
74 distro_id = os_release.get("ID", "")
75 version_id = os_release.get("VERSION_ID", "")
76
77 try:
78 version = int(version_id)
79 except ValueError:
80 return False
81
82 # Fedora 43+ ships skopeo 1.21.0+
83 if distro_id == "fedora" and version >= 43:
84 return True
85
86 return False
87
88
89class RegistryHandler(http.server.BaseHTTPRequestHandler):

Callers 1

mainFunction · 0.85

Calls 1

parse_os_releaseFunction · 0.70

Tested by

no test coverage detected