(run_lambda)
| 386 | |
| 387 | |
| 388 | def get_cpu_info(run_lambda): |
| 389 | rc, out, err = 0, "", "" |
| 390 | if get_platform() == "linux": |
| 391 | rc, out, err = run_lambda("lscpu") |
| 392 | elif get_platform() == "win32": |
| 393 | rc, out, err = run_lambda( |
| 394 | "wmic cpu get Name,Manufacturer,Family,Architecture,ProcessorType,DeviceID, \ |
| 395 | CurrentClockSpeed,MaxClockSpeed,L2CacheSize,L2CacheSpeed,Revision /VALUE" |
| 396 | ) |
| 397 | elif get_platform() == "darwin": |
| 398 | rc, out, err = run_lambda("sysctl -n machdep.cpu.brand_string") |
| 399 | cpu_info = "None" |
| 400 | if rc == 0: |
| 401 | cpu_info = out |
| 402 | else: |
| 403 | cpu_info = err |
| 404 | return cpu_info |
| 405 | |
| 406 | |
| 407 | def get_platform(): |
no test coverage detected