refactor: Remove unused get_logs method from a Service

This commit is contained in:
Inex Code 2024-12-21 15:17:34 +03:00
parent 7d9150a77a
commit 4f4673cfb9
No known key found for this signature in database
12 changed files with 0 additions and 51 deletions

View file

@ -187,11 +187,6 @@ class ServiceManager(Service):
"""
pass
@staticmethod
def get_logs():
# TODO: maybe return the logs for api itself
return ""
@classmethod
def get_drive(cls) -> str:
return BlockDevices().get_root_block_device().name

View file

@ -104,10 +104,6 @@ class Bitwarden(Service):
def restart():
subprocess.run(["systemctl", "restart", "vaultwarden.service"])
@staticmethod
def get_logs():
return ""
@staticmethod
def get_folders() -> List[str]:
return ["/var/lib/bitwarden", "/var/lib/bitwarden_rs"]

View file

@ -128,10 +128,6 @@ class Forgejo(Service):
def restart():
subprocess.run(["systemctl", "restart", "forgejo.service"])
@staticmethod
def get_logs():
return ""
@staticmethod
def get_folders() -> List[str]:
"""The data folder is still called gitea for compatibility."""

View file

@ -101,10 +101,6 @@ class JitsiMeet(Service):
)
subprocess.run(["systemctl", "restart", "jicofo.service"], check=False)
@staticmethod
def get_logs():
return ""
@staticmethod
def get_folders() -> List[str]:
return ["/var/lib/jitsi-meet"]

View file

@ -89,10 +89,6 @@ class MailServer(Service):
subprocess.run(["systemctl", "restart", "dovecot2.service"], check=False)
subprocess.run(["systemctl", "restart", "postfix.service"], check=False)
@staticmethod
def get_logs():
return ""
@staticmethod
def get_folders() -> List[str]:
return ["/var/vmail", "/var/sieve"]

View file

@ -94,11 +94,6 @@ class Nextcloud(Service):
"""Restart Nextcloud service."""
subprocess.Popen(["systemctl", "restart", "phpfpm-nextcloud.service"])
@staticmethod
def get_logs():
"""Return Nextcloud logs."""
return ""
@staticmethod
def get_folders() -> List[str]:
return ["/var/lib/nextcloud"]

View file

@ -74,10 +74,6 @@ class Ocserv(Service):
def set_configuration(cls, config_items):
return super().set_configuration(config_items)
@staticmethod
def get_logs():
return ""
@staticmethod
def get_folders() -> typing.List[str]:
return []

View file

@ -69,10 +69,6 @@ class Pleroma(Service):
def set_configuration(cls, config_items):
return super().set_configuration(config_items)
@staticmethod
def get_logs():
return ""
@staticmethod
def get_owned_folders() -> List[OwnedPath]:
"""

View file

@ -71,10 +71,6 @@ class Prometheus(Service):
def restart():
subprocess.run(["systemctl", "restart", "prometheus.service"])
@staticmethod
def get_logs():
return ""
@staticmethod
def get_owned_folders() -> List[OwnedPath]:
return [

View file

@ -92,10 +92,6 @@ class Roundcube(Service):
check=False,
)
@staticmethod
def get_logs():
return ""
@staticmethod
def get_folders() -> List[str]:
return []

View file

@ -226,11 +226,6 @@ class Service(ABC):
cls.get_id(),
)
@staticmethod
@abstractmethod
def get_logs():
pass
@classmethod
def get_storage_usage(cls) -> int:
"""

View file

@ -195,10 +195,6 @@ class DummyService(Service):
def set_configuration(cls, config_items):
return super().set_configuration(config_items)
@staticmethod
def get_logs():
return ""
@staticmethod
def get_storage_usage() -> int:
storage_usage = 0