add y_n function

This commit is contained in:
Andreas Zweili 2021-12-19 19:14:23 +01:00
parent 2e278d85bb
commit 0c14b063c9
1 changed files with 10 additions and 0 deletions

View File

@ -17,6 +17,16 @@ def _get_system_memory():
return round(mem_gib)
def _y_n(question):
answer = input("{} (Y/N): ".format(question))
if answer.lower() == "y":
return True
if answer.lower() == "n":
return False
print("Please only anwser with Y or N!")
sys.exit(1)
def read_disks():
output = _run_command(["lsblk", "-dpno", "name"])
disks = []