@cryptotaxi247 / netdata-1 / commits / 938bcf54a

Replace distutils with packaging for version (#16259)

Emmanuel Vasilakis committed Oct 31, 2023 at 12:16 UTC 938bcf54af73e2c28e3cefa1b7fe24de90548241
1 file changed -19
collectors/python.d.plugin/python_modules/bases/FrameworkServices/UrlService.py
-19
@@ -6,8 +6,6 @@
6
7 import urllib3
8
9 -from distutils.version import StrictVersion as version
10 -
9 from bases.FrameworkServices.SimpleService import SimpleService
10
11 try:
@@ -15,28 +13,11 @@ try:
13 except AttributeError:
14 pass
15
18 -# https://github.com/urllib3/urllib3/blob/master/CHANGES.rst#19-2014-07-04
19 -# New retry logic and urllib3.util.retry.Retry configuration object. (Issue https://github.com/urllib3/urllib3/pull/326)
20 -URLLIB3_MIN_REQUIRED_VERSION = '1.9'
16 URLLIB3_VERSION = urllib3.__version__
17 URLLIB3 = 'urllib3'
18
24 -
25 -def version_check():
26 - if version(URLLIB3_VERSION) >= version(URLLIB3_MIN_REQUIRED_VERSION):
27 - return
28 -
29 - err = '{0} version: {1}, minimum required version: {2}, please upgrade'.format(
30 - URLLIB3,
31 - URLLIB3_VERSION,
32 - URLLIB3_MIN_REQUIRED_VERSION,
33 - )
34 - raise Exception(err)
35 -
36 -
19 class UrlService(SimpleService):
20 def __init__(self, configuration=None, name=None):
39 - version_check()
21 SimpleService.__init__(self, configuration=configuration, name=name)
22 self.debug("{0} version: {1}".format(URLLIB3, URLLIB3_VERSION))
23 self.url = self.configuration.get('url')