mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 11:26:31 +00:00
replace get hardware info to powershell instead of wmic
This commit is contained in:
@@ -45,9 +45,11 @@ cdef class HardwareService:
|
|||||||
cdef HardwareInfo get_hardware_info(self):
|
cdef HardwareInfo get_hardware_info(self):
|
||||||
if self.is_windows:
|
if self.is_windows:
|
||||||
os_command = (
|
os_command = (
|
||||||
"wmic CPU get Name /Value && "
|
"powershell -Command \""
|
||||||
"wmic path Win32_VideoController get Name /Value && "
|
"Get-CimInstance -ClassName Win32_Processor | Select-Object -ExpandProperty Name | Write-Output; "
|
||||||
"wmic OS get TotalVisibleMemorySize /Value"
|
"Get-CimInstance -ClassName Win32_VideoController | Select-Object -ExpandProperty Name | Write-Output; "
|
||||||
|
"Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object -ExpandProperty TotalVisibleMemorySize | Write-Output"
|
||||||
|
"\""
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
os_command = (
|
os_command = (
|
||||||
|
|||||||
@@ -102,9 +102,11 @@ class HWService:
|
|||||||
def get_hardware_info(self):
|
def get_hardware_info(self):
|
||||||
if self.is_windows:
|
if self.is_windows:
|
||||||
os_command = (
|
os_command = (
|
||||||
"wmic CPU get Name /Value && "
|
"powershell -Command \""
|
||||||
"wmic path Win32_VideoController get Name /Value && "
|
"Get-CimInstance -ClassName Win32_Processor | Select-Object -ExpandProperty Name | Write-Output; "
|
||||||
"wmic OS get TotalVisibleMemorySize /Value"
|
"Get-CimInstance -ClassName Win32_VideoController | Select-Object -ExpandProperty Name | Write-Output; "
|
||||||
|
"Get-CimInstance -ClassName Win32_OperatingSystem | Select-Object -ExpandProperty TotalVisibleMemorySize | Write-Output"
|
||||||
|
"\""
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
os_command = (
|
os_command = (
|
||||||
@@ -225,12 +227,15 @@ class Api:
|
|||||||
|
|
||||||
credentials = Credentials('admin@azaion.com', 'Az@1on1000Odm$n', 'stage')
|
credentials = Credentials('admin@azaion.com', 'Az@1on1000Odm$n', 'stage')
|
||||||
api = Api(credentials)
|
api = Api(credentials)
|
||||||
|
|
||||||
file = 'file1'
|
file = 'file1'
|
||||||
sha256_init = Api.create_file(file, size_mb=100)
|
sha256_init = Api.create_file(file, size_mb=1)
|
||||||
api.upload_file(file)
|
api.upload_file(file)
|
||||||
|
|
||||||
file_bytes = api.load_bytes(file)
|
file_bytes = api.load_bytes(file)
|
||||||
print(f'received: {len(file_bytes)/1024} kb')
|
|
||||||
sha256_downloaded = Api.get_sha256(file_bytes)
|
#
|
||||||
print(f'{sha256_init}: sha256 initial file')
|
# print(f'received: {len(file_bytes)/1024} kb')
|
||||||
print(f'{sha256_downloaded}: sha256 downloaded file')
|
# sha256_downloaded = Api.get_sha256(file_bytes)
|
||||||
|
# print(f'{sha256_init}: sha256 initial file')
|
||||||
|
# print(f'{sha256_downloaded}: sha256 downloaded file')
|
||||||
|
|||||||
Reference in New Issue
Block a user