fix(services): use get_foldername() for moving around

This commit is contained in:
Houkime 2023-04-17 12:54:21 +00:00
parent 1c0e3f0f92
commit 0207b5a473
3 changed files with 6 additions and 2 deletions

View file

@ -160,7 +160,7 @@ class Bitwarden(Service):
job, job,
[ [
FolderMoveNames( FolderMoveNames(
name="bitwarden", name=Bitwarden.get_foldername(folder),
bind_location=folder, bind_location=folder,
group="vaultwarden", group="vaultwarden",
owner="vaultwarden", owner="vaultwarden",

View file

@ -158,7 +158,7 @@ class Gitea(Service):
job, job,
[ [
FolderMoveNames( FolderMoveNames(
name="gitea", name=Gitea.get_foldername(folder),
bind_location=folder, bind_location=folder,
group="gitea", group="gitea",
owner="gitea", owner="gitea",

View file

@ -140,6 +140,10 @@ class Service(ABC):
# def get_folders() -> str: # def get_folders() -> str:
# pass # pass
@staticmethod
def get_foldername(path: str) -> str:
return path.split("/")[-1]
@abstractmethod @abstractmethod
def move_to_volume(self, volume: BlockDevice) -> Job: def move_to_volume(self, volume: BlockDevice) -> Job:
pass pass