menderbot.check.run_check()   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 8
nop 1
dl 0
loc 10
rs 10
c 0
b 0
f 0
1
import subprocess
2
3
4
def run_check(command: str) -> tuple[bool, str]:
5
    try:
6
        return (
7
            True,
8
            subprocess.check_output(
9
                command, stderr=subprocess.STDOUT, shell=True, text=True
10
            ),
11
        )
12
    except subprocess.CalledProcessError as e:
13
        return (False, e.output)
14