diff --git a/VOLUME_CHECK.spec b/VOLUME_CHECK.spec new file mode 100644 index 0000000..52623f0 --- /dev/null +++ b/VOLUME_CHECK.spec @@ -0,0 +1,44 @@ +# -*- mode: python ; coding: utf-8 -*- + + +block_cipher = None + + +a = Analysis( + ['main.py'], + pathex=[], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False, +) +pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) + +exe = EXE( + pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + [], + name='VOLUME_CHECK', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=True, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, +) diff --git a/build/VOLUME_CHECK/Analysis-00.toc b/build/VOLUME_CHECK/Analysis-00.toc index 293155d..730ff87 100644 --- a/build/VOLUME_CHECK/Analysis-00.toc +++ b/build/VOLUME_CHECK/Analysis-00.toc @@ -401,6 +401,18 @@ 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\lib\\xml\\sax\\xmlreader.py', 'PYMODULE'), + ('http.client', + 'C:\\Users\\Sebastian ' + 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\lib\\http\\client.py', + 'PYMODULE'), + ('ssl', + 'C:\\Users\\Sebastian ' + 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\lib\\ssl.py', + 'PYMODULE'), + ('http', + 'C:\\Users\\Sebastian ' + 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\lib\\http\\__init__.py', + 'PYMODULE'), ('hmac', 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\lib\\hmac.py', @@ -501,6 +513,18 @@ 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\lib\\multiprocessing\\__init__.py', 'PYMODULE'), + ('stringprep', + 'C:\\Users\\Sebastian ' + 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\lib\\stringprep.py', + 'PYMODULE'), + ('tracemalloc', + 'C:\\Users\\Sebastian ' + 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\lib\\tracemalloc.py', + 'PYMODULE'), + ('_py_abc', + 'C:\\Users\\Sebastian ' + 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_py_abc.py', + 'PYMODULE'), ('getpass', 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\lib\\getpass.py', @@ -529,30 +553,6 @@ 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\lib\\http\\cookiejar.py', 'PYMODULE'), - ('http', - 'C:\\Users\\Sebastian ' - 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\lib\\http\\__init__.py', - 'PYMODULE'), - ('ssl', - 'C:\\Users\\Sebastian ' - 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\lib\\ssl.py', - 'PYMODULE'), - ('stringprep', - 'C:\\Users\\Sebastian ' - 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\lib\\stringprep.py', - 'PYMODULE'), - ('_py_abc', - 'C:\\Users\\Sebastian ' - 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\lib\\_py_abc.py', - 'PYMODULE'), - ('tracemalloc', - 'C:\\Users\\Sebastian ' - 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\lib\\tracemalloc.py', - 'PYMODULE'), - ('http.client', - 'C:\\Users\\Sebastian ' - 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\lib\\http\\client.py', - 'PYMODULE'), ('volume', 'C:\\Users\\Sebastian Serfling\\PycharmProjects\\volume_check\\volume.py', 'PYMODULE'), @@ -664,10 +664,6 @@ 'C:\\Users\\Sebastian ' 'Serfling\\PycharmProjects\\volume_check\\venv\\lib\\site-packages\\cpuinfo\\cpuinfo.py', 'PYMODULE'), - ('create_service', - 'C:\\Users\\Sebastian ' - 'Serfling\\PycharmProjects\\volume_check\\create_service.py', - 'PYMODULE'), ('datetime', 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\lib\\datetime.py', @@ -976,6 +972,10 @@ 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\pyexpat.pyd', 'EXTENSION'), + ('_ssl.pyd', + 'C:\\Users\\Sebastian ' + 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\_ssl.pyd', + 'EXTENSION'), ('_multiprocessing.pyd', 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\_multiprocessing.pyd', @@ -988,10 +988,6 @@ 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\_queue.pyd', 'EXTENSION'), - ('_ssl.pyd', - 'C:\\Users\\Sebastian ' - 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\_ssl.pyd', - 'EXTENSION'), ('unicodedata.pyd', 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\unicodedata.pyd', @@ -1020,14 +1016,14 @@ 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\libcrypto-1_1.dll', 'BINARY'), - ('libffi-7.dll', - 'C:\\Users\\Sebastian ' - 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\libffi-7.dll', - 'BINARY'), ('libssl-1_1.dll', 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\libssl-1_1.dll', 'BINARY'), + ('libffi-7.dll', + 'C:\\Users\\Sebastian ' + 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\libffi-7.dll', + 'BINARY'), ('python3.dll', 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\python3.dll', @@ -1038,12 +1034,12 @@ 'C:\\Users\\Sebastian ' 'Serfling\\PycharmProjects\\volume_check\\build\\VOLUME_CHECK\\base_library.zip', 'DATA'), - ('certifi\\py.typed', - 'C:\\Users\\Sebastian ' - 'Serfling\\PycharmProjects\\volume_check\\venv\\lib\\site-packages\\certifi\\py.typed', - 'DATA'), ('certifi\\cacert.pem', 'C:\\Users\\Sebastian ' 'Serfling\\PycharmProjects\\volume_check\\venv\\lib\\site-packages\\certifi\\cacert.pem', + 'DATA'), + ('certifi\\py.typed', + 'C:\\Users\\Sebastian ' + 'Serfling\\PycharmProjects\\volume_check\\venv\\lib\\site-packages\\certifi\\py.typed', 'DATA')], []) diff --git a/build/VOLUME_CHECK/EXE-00.toc b/build/VOLUME_CHECK/EXE-00.toc index 40d30b8..a550900 100644 --- a/build/VOLUME_CHECK/EXE-00.toc +++ b/build/VOLUME_CHECK/EXE-00.toc @@ -92,6 +92,10 @@ 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\pyexpat.pyd', 'EXTENSION'), + ('_ssl.pyd', + 'C:\\Users\\Sebastian ' + 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\_ssl.pyd', + 'EXTENSION'), ('_multiprocessing.pyd', 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\_multiprocessing.pyd', @@ -104,10 +108,6 @@ 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\_queue.pyd', 'EXTENSION'), - ('_ssl.pyd', - 'C:\\Users\\Sebastian ' - 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\_ssl.pyd', - 'EXTENSION'), ('unicodedata.pyd', 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\unicodedata.pyd', @@ -136,14 +136,14 @@ 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\libcrypto-1_1.dll', 'BINARY'), - ('libffi-7.dll', - 'C:\\Users\\Sebastian ' - 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\libffi-7.dll', - 'BINARY'), ('libssl-1_1.dll', 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\libssl-1_1.dll', 'BINARY'), + ('libffi-7.dll', + 'C:\\Users\\Sebastian ' + 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\libffi-7.dll', + 'BINARY'), ('python3.dll', 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\python3.dll', @@ -152,18 +152,18 @@ 'C:\\Users\\Sebastian ' 'Serfling\\PycharmProjects\\volume_check\\build\\VOLUME_CHECK\\base_library.zip', 'DATA'), - ('certifi\\py.typed', - 'C:\\Users\\Sebastian ' - 'Serfling\\PycharmProjects\\volume_check\\venv\\lib\\site-packages\\certifi\\py.typed', - 'DATA'), ('certifi\\cacert.pem', 'C:\\Users\\Sebastian ' 'Serfling\\PycharmProjects\\volume_check\\venv\\lib\\site-packages\\certifi\\cacert.pem', + 'DATA'), + ('certifi\\py.typed', + 'C:\\Users\\Sebastian ' + 'Serfling\\PycharmProjects\\volume_check\\venv\\lib\\site-packages\\certifi\\py.typed', 'DATA')], [], False, False, - 1692634256, + 1694611831, [('run.exe', 'C:\\Users\\Sebastian ' 'Serfling\\PycharmProjects\\volume_check\\venv\\lib\\site-packages\\PyInstaller\\bootloader\\Windows-64bit-intel\\run.exe', diff --git a/build/VOLUME_CHECK/PKG-00.toc b/build/VOLUME_CHECK/PKG-00.toc index d7f84b3..64b4b0c 100644 --- a/build/VOLUME_CHECK/PKG-00.toc +++ b/build/VOLUME_CHECK/PKG-00.toc @@ -83,6 +83,10 @@ 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\pyexpat.pyd', 'EXTENSION'), + ('_ssl.pyd', + 'C:\\Users\\Sebastian ' + 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\_ssl.pyd', + 'EXTENSION'), ('_multiprocessing.pyd', 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\_multiprocessing.pyd', @@ -95,10 +99,6 @@ 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\_queue.pyd', 'EXTENSION'), - ('_ssl.pyd', - 'C:\\Users\\Sebastian ' - 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\_ssl.pyd', - 'EXTENSION'), ('unicodedata.pyd', 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\unicodedata.pyd', @@ -127,14 +127,14 @@ 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\libcrypto-1_1.dll', 'BINARY'), - ('libffi-7.dll', - 'C:\\Users\\Sebastian ' - 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\libffi-7.dll', - 'BINARY'), ('libssl-1_1.dll', 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\libssl-1_1.dll', 'BINARY'), + ('libffi-7.dll', + 'C:\\Users\\Sebastian ' + 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\DLLs\\libffi-7.dll', + 'BINARY'), ('python3.dll', 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\python3.dll', @@ -143,13 +143,13 @@ 'C:\\Users\\Sebastian ' 'Serfling\\PycharmProjects\\volume_check\\build\\VOLUME_CHECK\\base_library.zip', 'DATA'), - ('certifi\\py.typed', - 'C:\\Users\\Sebastian ' - 'Serfling\\PycharmProjects\\volume_check\\venv\\lib\\site-packages\\certifi\\py.typed', - 'DATA'), ('certifi\\cacert.pem', 'C:\\Users\\Sebastian ' 'Serfling\\PycharmProjects\\volume_check\\venv\\lib\\site-packages\\certifi\\cacert.pem', + 'DATA'), + ('certifi\\py.typed', + 'C:\\Users\\Sebastian ' + 'Serfling\\PycharmProjects\\volume_check\\venv\\lib\\site-packages\\certifi\\py.typed', 'DATA')], False, False, diff --git a/build/VOLUME_CHECK/PYZ-00.pyz b/build/VOLUME_CHECK/PYZ-00.pyz index 352abd9..3aae70d 100644 Binary files a/build/VOLUME_CHECK/PYZ-00.pyz and b/build/VOLUME_CHECK/PYZ-00.pyz differ diff --git a/build/VOLUME_CHECK/PYZ-00.toc b/build/VOLUME_CHECK/PYZ-00.toc index fc23c2c..9c6504d 100644 --- a/build/VOLUME_CHECK/PYZ-00.toc +++ b/build/VOLUME_CHECK/PYZ-00.toc @@ -120,10 +120,6 @@ 'C:\\Users\\Sebastian ' 'Serfling\\PycharmProjects\\volume_check\\venv\\lib\\site-packages\\cpuinfo\\cpuinfo.py', 'PYMODULE'), - ('create_service', - 'C:\\Users\\Sebastian ' - 'Serfling\\PycharmProjects\\volume_check\\create_service.py', - 'PYMODULE'), ('csv', 'C:\\Users\\Sebastian ' 'Serfling\\AppData\\Local\\Programs\\Python\\Python39\\lib\\csv.py', diff --git a/build/VOLUME_CHECK/VOLUME_CHECK.pkg b/build/VOLUME_CHECK/VOLUME_CHECK.pkg index 3dd960e..aec407f 100644 Binary files a/build/VOLUME_CHECK/VOLUME_CHECK.pkg and b/build/VOLUME_CHECK/VOLUME_CHECK.pkg differ diff --git a/build/VOLUME_CHECK/base_library.zip b/build/VOLUME_CHECK/base_library.zip index b8d9d24..6e7223c 100644 Binary files a/build/VOLUME_CHECK/base_library.zip and b/build/VOLUME_CHECK/base_library.zip differ diff --git a/build/VOLUME_CHECK/warn-VOLUME_CHECK.txt b/build/VOLUME_CHECK/warn-VOLUME_CHECK.txt index deec907..3ee0675 100644 --- a/build/VOLUME_CHECK/warn-VOLUME_CHECK.txt +++ b/build/VOLUME_CHECK/warn-VOLUME_CHECK.txt @@ -18,9 +18,9 @@ missing module named pyimod02_importers - imported by C:\Users\Sebastian Serflin missing module named pep517 - imported by importlib.metadata (delayed) missing module named 'org.python' - imported by copy (optional), xml.sax (delayed, conditional) missing module named grp - imported by shutil (optional), tarfile (optional), pathlib (delayed, optional), subprocess (optional) -missing module named pwd - imported by shutil (optional), tarfile (optional), posixpath (delayed, conditional), pathlib (delayed, conditional, optional), subprocess (optional), netrc (delayed, conditional), getpass (delayed), psutil (optional) +missing module named pwd - imported by posixpath (delayed, conditional), shutil (optional), tarfile (optional), pathlib (delayed, conditional, optional), subprocess (optional), netrc (delayed, conditional), getpass (delayed), psutil (optional) missing module named org - imported by pickle (optional) -missing module named posix - imported by shutil (conditional), importlib._bootstrap_external (conditional), os (conditional, optional) +missing module named posix - imported by os (conditional, optional), shutil (conditional), importlib._bootstrap_external (conditional) missing module named resource - imported by posix (top-level), psutil._pslinux (optional) excluded module named _frozen_importlib - imported by importlib (optional), importlib.abc (optional), zipimport (top-level) missing module named _frozen_importlib_external - imported by importlib._bootstrap (delayed), importlib (optional), importlib.abc (optional), zipimport (top-level) diff --git a/build/VOLUME_CHECK/xref-VOLUME_CHECK.html b/build/VOLUME_CHECK/xref-VOLUME_CHECK.html index 6c1facb..7f6f29b 100644 --- a/build/VOLUME_CHECK/xref-VOLUME_CHECK.html +++ b/build/VOLUME_CHECK/xref-VOLUME_CHECK.html @@ -26,7 +26,6 @@ imports: • collectionscollections.abccopyreg - • create_servicedatetimeencodingsencodings.aliases @@ -155,7 +154,6 @@ imports: • functoolsgenericpathheapq - • http.clientiokeywordlinecache @@ -2279,26 +2277,6 @@ imported by: -
- - create_service -SourceModule
-imports: - os - • requests - • shutil - • time - • zipfile - -
-
-imported by: - main.py - -
- -
-
cryptography @@ -5952,7 +5930,6 @@ imports:
imported by: http.cookiejar - • main.pyurllib.requesturllib3.connectionurllib3.exceptions @@ -7890,7 +7867,6 @@ imported by: • charset_normalizer.apiconfigparsercpuinfo.cpuinfo - • create_servicectypescursesemail.utils @@ -8869,8 +8845,7 @@ imports:
imported by: - create_service - • main.py + main.pyrequestsrequests.__version__requests._internal_utils @@ -9436,7 +9411,6 @@ imports:
imported by: argparse - • create_servicemultiprocessing.utilpsutil._compattarfile @@ -10118,7 +10092,6 @@ imported by: _datetime_strptimecpuinfo.cpuinfo - • create_servicedatetimeemail._parseaddremail.generator @@ -11974,8 +11947,7 @@ imports:
imported by: - create_service - • importlib._common + importlib._commonimportlib.metadatarequests.utilsshutil diff --git a/dist/VOLUME_CHECK.exe b/dist/VOLUME_CHECK.exe index df7cd15..6ab95ab 100644 Binary files a/dist/VOLUME_CHECK.exe and b/dist/VOLUME_CHECK.exe differ diff --git a/dist/zls_check.txt b/dist/zls_check.txt new file mode 100644 index 0000000..9233c01 --- /dev/null +++ b/dist/zls_check.txt @@ -0,0 +1 @@ +Volume not Found 2023-09-13 15:24:40.125231 - User: Sebastian Serfling diff --git a/log.txt b/log.txt new file mode 100644 index 0000000..0611260 --- /dev/null +++ b/log.txt @@ -0,0 +1,6 @@ +13.09.2023 14:39 - Sebastian Serfling has no access to X: \\172.19.1.3\deployment +Keine Netvolume vorhanden! +Keine Netvolume vorhanden! +Keine Netvolume vorhanden! +Keine Netvolume vorhanden! +Keine Netvolume vorhanden! diff --git a/main.py b/main.py index a5ca065..c31f1b8 100644 --- a/main.py +++ b/main.py @@ -4,12 +4,9 @@ import requests import time import socket import datetime -import create_service import system_info import volume -create_service.addservice("VOLUME_CHECK") ## CREATE VOLUME - def request(function,variable): ##API-SErver url = (f"http://api.stines.de:8001/{function}") response = requests.post(url,json = variable,headers={'access_token':'^YWUbG7yX*V!tV^KBSd*2c&vdN3wV9a2i7f3hfGFMBYFxi6#mMiJGiaA5KEHE%B*miK%qb7rQ67gmcYP@gqmux8'}) @@ -25,12 +22,18 @@ def check_volume_exist(): user = os.getlogin() ## GET CURRENT USER database = request("info/getclient",{"name":hostname}).text.replace('"',"") ##GET DATABASE FROM SQL-SERVER volume_get = request("info/getvolume",{"name":hostname,"database":database}) ##GET VOLUMES FROM SQL-SERVER + print(volume_get.text) space_free = str(system_info.get_single_hdd("free")).replace("['","").replace("]","").replace("'","").replace(",",";") ## FREE SPACE OF VOLUME space_used = str(system_info.get_single_hdd("used")).replace("['","").replace("]","").replace("'","").replace(",",";") ## USED SPACE OF VOLUME space_total = str(system_info.get_single_hdd("total")).replace("['","").replace("]","").replace("'","").replace(",",";") ## TOTAL SPACE OF VOLUME if volume_get.text == "false": + print(volume.get_netvolume()) + if volume.get_netvolume() is None: + with open("log.txt", "a") as datei: + datei.writelines(f"Keine Netvolume vorhanden!" + "\n") ## WRITE TO ERRORLOG + pushover_send("Keine Netvolume vorhanden!", hostname) ## SEND ERROR LOG TO PUSHOVER netvolume = volume.get_netvolume() values = ( f"'{hostname}','{system_info.get_local_ip()}','{system_info.get_winver()}','{system_info.get_cpu_brand()}','{system_info.get_cpu_core()}','{system_info.get_ram_info()}','{space_total}','{space_free}','{space_used}'") diff --git a/volume.py b/volume.py index 00a90af..36ebfca 100644 --- a/volume.py +++ b/volume.py @@ -9,17 +9,29 @@ def get_netvolume(): "Select-Object DeviceID,ProviderName | " "ConvertTo-Json" ) - + volume_count = ("(Get-CimInstance -ClassName Win32_LogicalDisk | Where-Object -Property DriveType -EQ 4).Count") # PowerShell-Befehl ausführen und das Ergebnis in eine Python-Variable laden result = subprocess.run( ["powershell", "-Command", powershell_command], capture_output=True, text=True ) - - # Die Ausgabe als JSON interpretieren und in ein Python-Array laden - net_drives = json.loads(result.stdout) + volume_count_result = subprocess.run ( + ["powershell", "-Command", volume_count], + capture_output=True, + text=True + ) volumes = [] - for i in net_drives: - volumes.append(f"{i['DeviceID']};{i['ProviderName']}") - return volumes \ No newline at end of file + if result.stdout != '': + net_drives = json.loads(result.stdout) + else: + return None + if volume_count_result.stdout != '': + for i in net_drives: + volumes.append(f"{i['DeviceID']};{i['ProviderName']}") + return volumes + else: + volumes.append(f"{net_drives['DeviceID'][0]};{net_drives['ProviderName']}") + return volumes + # Die Ausgabe alvolumess JSON interpretieren und in ein Python-Array laden +print(get_netvolume()) \ No newline at end of file