Commit 11afbd15 authored by Jérome Perrin's avatar Jérome Perrin

grid/distribution: fix linter warnings

parent c4902375
Pipeline #9324 passed with stage
in 0 seconds
...@@ -49,12 +49,12 @@ import platform ...@@ -49,12 +49,12 @@ import platform
import re import re
def _debianize(os): def _debianize(os_):
""" """
keep only the major release number in case of debian, otherwise keep only the major release number in case of debian, otherwise
minor releases would be seen as not compatible to each other. minor releases would be seen as not compatible to each other.
""" """
distname, version, id_ = os distname, version, id_ = os_
distname_lower = distname.lower() distname_lower = distname.lower()
if distname_lower == 'debian' and '.' in version: if distname_lower == 'debian' and '.' in version:
version = version.split('.')[0] version = version.split('.')[0]
...@@ -66,9 +66,9 @@ def os_matches(os1, os2): ...@@ -66,9 +66,9 @@ def os_matches(os1, os2):
return _debianize(os1) == _debianize(os2) return _debianize(os1) == _debianize(os2)
_distributor_id_file_re = re.compile("(?:DISTRIB_ID\s*=)\s*(.*)", re.I) _distributor_id_file_re = re.compile(r"(?:DISTRIB_ID\s*=)\s*(.*)", re.I)
_release_file_re = re.compile("(?:DISTRIB_RELEASE\s*=)\s*(.*)", re.I) _release_file_re = re.compile(r"(?:DISTRIB_RELEASE\s*=)\s*(.*)", re.I)
_codename_file_re = re.compile("(?:DISTRIB_CODENAME\s*=)\s*(.*)", re.I) _codename_file_re = re.compile(r"(?:DISTRIB_CODENAME\s*=)\s*(.*)", re.I)
def patched_linux_distribution(distname='', version='', id='', def patched_linux_distribution(distname='', version='', id='',
...@@ -91,7 +91,7 @@ def patched_linux_distribution(distname='', version='', id='', ...@@ -91,7 +91,7 @@ def patched_linux_distribution(distname='', version='', id='',
if _u_distname and _u_version: if _u_distname and _u_version:
return (_u_distname, _u_version, _u_id) return (_u_distname, _u_version, _u_id)
except (EnvironmentError, UnboundLocalError): except (EnvironmentError, UnboundLocalError):
pass pass
return platform.linux_distribution(distname, version, id, supported_dists, full_distribution_name) return platform.linux_distribution(distname, version, id, supported_dists, full_distribution_name)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment