mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-30 04:36:39 +00:00
refactor: Remove unused get_logs method from a Service
This commit is contained in:
parent
7d9150a77a
commit
4f4673cfb9
|
@ -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
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -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."""
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -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"]
|
||||
|
|
|
@ -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 []
|
||||
|
|
|
@ -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]:
|
||||
"""
|
||||
|
|
|
@ -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 [
|
||||
|
|
|
@ -92,10 +92,6 @@ class Roundcube(Service):
|
|||
check=False,
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def get_logs():
|
||||
return ""
|
||||
|
||||
@staticmethod
|
||||
def get_folders() -> List[str]:
|
||||
return []
|
||||
|
|
|
@ -226,11 +226,6 @@ class Service(ABC):
|
|||
cls.get_id(),
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
@abstractmethod
|
||||
def get_logs():
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def get_storage_usage(cls) -> int:
|
||||
"""
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue