added some todos

This commit is contained in:
Michael Jerger 2023-05-25 14:50:12 +02:00
parent 664f3cfd79
commit 20edebf61c

View file

@ -49,9 +49,11 @@ class TerraformService:
output = f"cd {devops.build_path()} && {terraform.latest_cmd()}"
print(output)
# TODO: internal?
def copy_local_state(self, devops: Devops):
self.file_api.cp("terraform.tfstate", devops.build_path(), check=False)
# TODO: internal?
def rescue_local_state(self, devops: Devops):
self.file_api.cp(f"{devops.build_path()}/terraform.tfstate", ".", check=False)
@ -67,6 +69,7 @@ class TerraformService:
self.file_api.cp("*.tfvars", devops.build_path(), check=False)
self.file_api.cp_recursive("scripts", devops.build_path(), check=False)
# TODO: internal?
def init_client(self, devops: Devops):
terraform_domain = devops.specialized_builds[BuildType.TERRAFORM]
terraform = Terraform(
@ -84,6 +87,7 @@ class TerraformService:
self.__print_terraform_command__(terraform, devops)
return terraform
# TODO: internal?
def write_output(self, terraform, devops: Devops):
terraform_domain = devops.specialized_builds[BuildType.TERRAFORM]
result = terraform.output(json=IsFlagged)
@ -92,7 +96,7 @@ class TerraformService:
Path(f"{devops.build_path()}{terraform_domain.tf_output_json_name}"), result
)
def read_output(self, devops: Devops):
def read_output(self, devops: Devops) -> map:
terraform_domain = devops.specialized_builds[BuildType.TERRAFORM]
return self.file_api.read_json_fro_file(
Path(f"{devops.build_path()}{terraform_domain.tf_output_json_name}")