Update node_exporter_manager.py
This commit is contained in:
@ -60,6 +60,8 @@ def get_local_version():
|
||||
return None
|
||||
|
||||
def download_and_extract(url, download_path='/tmp'):
|
||||
import sys
|
||||
|
||||
filename = os.path.join(download_path, url.split('/')[-1])
|
||||
try:
|
||||
with requests.get(url, stream=True, timeout=30) as r:
|
||||
@ -72,7 +74,11 @@ def download_and_extract(url, download_path='/tmp'):
|
||||
raise
|
||||
|
||||
with tarfile.open(filename) as tar:
|
||||
tar.extractall(path=download_path, filter='data')
|
||||
if sys.version_info >= (3, 12):
|
||||
tar.extractall(path=download_path, filter='data')
|
||||
else:
|
||||
tar.extractall(path=download_path)
|
||||
|
||||
return next(Path(download_path).glob('node_exporter-*'))
|
||||
|
||||
# ----------------- INSTALACJA I KONFIGURACJA -----------------
|
||||
|
Reference in New Issue
Block a user