test: deal with missing sfdisk correctly
This commit is contained in:
parent
8bb399d269
commit
4a86688870
1 changed files with 8 additions and 5 deletions
|
|
@ -26,11 +26,14 @@ from .. import initrd, test
|
|||
|
||||
|
||||
def have_sfdisk_with_json():
|
||||
r = subprocess.run(["sfdisk", "--version"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf8",
|
||||
check=False)
|
||||
try:
|
||||
r = subprocess.run(["sfdisk", "--version"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf8",
|
||||
check=False)
|
||||
except FileNotFoundError:
|
||||
return False
|
||||
|
||||
if r.returncode != 0:
|
||||
return False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue