fix: not accepting blank root passwords

This commit is contained in:
Vinicius Moreira
2022-02-28 11:25:41 -03:00
parent 8a0609de06
commit ff9d3be65b
22 changed files with 126 additions and 120 deletions

View File

@@ -1,4 +1,5 @@
import shutil
from typing import Optional
from bauh.commons.system import SimpleProcess
@@ -7,9 +8,9 @@ def is_available() -> bool:
return bool(shutil.which('timeshift'))
def delete_all_snapshots(root_password: str) -> SimpleProcess:
def delete_all_snapshots(root_password: Optional[str]) -> SimpleProcess:
return SimpleProcess(['timeshift', '--delete-all', '--scripted'], root_password=root_password)
def create_snapshot(root_password: str, mode: str) -> SimpleProcess:
def create_snapshot(root_password: Optional[str], mode: str) -> SimpleProcess:
return SimpleProcess(['timeshift', '--create', '--scripted', '--{}'.format(mode)], root_password=root_password)