diff --git a/infrastructure/utils.py b/infrastructure/utils.py index b4cd18d..68ef92d 100644 --- a/infrastructure/utils.py +++ b/infrastructure/utils.py @@ -84,28 +84,28 @@ class Infra: """ return self._host_vars_dir(subdomain=subdomain).joinpath("provision.yml") - @staticmethod - def get_gitea_uri(instance: Instance) -> str: + @classmethod + def get_gitea_uri(cls, instance: Instance) -> str: """ Get an instance's Gitea URI """ base = settings.HOSTEA["INFRA"]["HOSTEA_DOMAIN"] - return f"https://{instance.name}{base}" + return f"https://{instance.name}.{base}" - @staticmethod - def _gen_woodpecker_hostname(instance: Instance) -> str: + @classmethod + def _gen_woodpecker_hostname(cls, instance: Instance) -> str: """ Get Woodpecker hostname of an instance """ return (f"{instance.name}-ci",) - @staticmethod - def get_woodpecker_hostname(instance: Instance) -> str: + @classmethod + def get_woodpecker_hostname(cls, instance: Instance) -> str: """ Get an instance's Gitea URI """ - base = settings.HOSTEA["INFRA"]["HOSTEA_DOMAIn"] - return f"https://{self._gen_woodpecker_hostname(instance=instance)}{base}" + base = settings.HOSTEA["INFRA"]["HOSTEA_DOMAIN"] + return f"https://{cls._gen_woodpecker_hostname(instance=instance)}.{base}" def get_flavor(self, instance: Instance): """