Merge pull request 'clan: remove flatpak check' (#1831) from kenji/clan-core:clan/rm-flatpak into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/1831
This commit is contained in:
@@ -18,7 +18,6 @@ from . import (
|
||||
config,
|
||||
facts,
|
||||
flash,
|
||||
flatpak,
|
||||
history,
|
||||
machines,
|
||||
secrets,
|
||||
@@ -408,8 +407,6 @@ def main() -> None:
|
||||
if getattr(args, "debug", False):
|
||||
setup_logging(logging.DEBUG, root_log_name=__name__.split(".")[0])
|
||||
log.debug("Debug log activated")
|
||||
if flatpak.is_flatpak():
|
||||
log.debug("Running inside a flatpak sandbox")
|
||||
else:
|
||||
setup_logging(logging.INFO, root_log_name=__name__.split(".")[0])
|
||||
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
import os
|
||||
|
||||
|
||||
def is_flatpak() -> bool:
|
||||
"""Check if the current process is running inside a flatpak sandbox."""
|
||||
# FLATPAK_ID environment variable check
|
||||
flatpak_env = "FLATPAK_ID" in os.environ
|
||||
|
||||
flatpak_file = False
|
||||
try:
|
||||
with open("/.flatpak-info"):
|
||||
flatpak_file = True
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
return flatpak_env and flatpak_file
|
||||
Reference in New Issue
Block a user