aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2018-06-21 22:59:42 +0100
committerChristopher Baines <mail@cbaines.net>2018-06-21 22:59:42 +0100
commit28a98595043eba29249578494bb21961f328bd05 (patch)
treec6c31f3eea04221e34b6075fb23bd4024c171348 /app
parentbf58270f0270298dae20616df6677eed2a568429 (diff)
downloadgovuk-mini-environment-admin-28a98595043eba29249578494bb21961f328bd05.tar
govuk-mini-environment-admin-28a98595043eba29249578494bb21961f328bd05.tar.gz
Extract out the mini_environment_state_id to a method
So that it can be used in other methods.
Diffstat (limited to 'app')
-rw-r--r--app/models/backends/terraform_libvirt/mini_environment_methods.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/backends/terraform_libvirt/mini_environment_methods.rb b/app/models/backends/terraform_libvirt/mini_environment_methods.rb
index 38e8809..5a915cf 100644
--- a/app/models/backends/terraform_libvirt/mini_environment_methods.rb
+++ b/app/models/backends/terraform_libvirt/mini_environment_methods.rb
@@ -65,11 +65,15 @@ module Backends::TerraformLibvirt::MiniEnvironmentMethods
def within_terraform_working_directory(mini_environment, &block)
TerraformWorkingDirectory.new(
- "mini_environment/#{mini_environment.id}",
+ mini_environment_state_id(mini_environment),
'terraform/libvirt/mini_environment'
).within_working_directory(&block)
end
+ def mini_environment_state_id(mini_environment)
+ "mini_environment/#{mini_environment.id}"
+ end
+
def signon_url(mini_environment)
"https://signon.#{mini_environment.name.parameterize}.#{domain}"
end