start introducing modules
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from os import getuid
|
||||
from pathlib import Path
|
||||
|
||||
from typing import Any
|
||||
|
||||
DISK_BY_UUID = Path("/dev/disk/by-uuid")
|
||||
MAPPER_PATH = Path("/dev/mapper")
|
||||
|
||||
|
||||
def assert_type(instance: Any, object_type: Any, message: str) -> None:
|
||||
if not isinstance(instance, object_type):
|
||||
raise TypeError(message)
|
||||
|
||||
|
||||
def verify_running_as_root() -> None:
|
||||
if getuid() > 0:
|
||||
raise PermissionError("Run as root.")
|
||||
Reference in New Issue
Block a user