This patch clarifies the error message to specify that the issue is that the reason that
the provider account can't be deleted, is because there are running deployments (since
instances can't be deleted directly).
Mainn
Show replies by date
---
src/app/models/provider_account.rb | 5 +++--
src/config/locales/en.yml | 2 +-
.../step_definitions/provider_account_steps.rb | 3 ++-
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/app/models/provider_account.rb b/src/app/models/provider_account.rb
index f23b286..acc7d64 100644
--- a/src/app/models/provider_account.rb
+++ b/src/app/models/provider_account.rb
@@ -149,8 +149,9 @@ class ProviderAccount < ActiveRecord::Base
true
else
raise Aeolus::Conductor::Base::NotDestroyable,
- I18n.t('provider_accounts.errors.not_destroyable_instances',
- :instances => not_destroyable_instances.map{|i| i.name}.join(',
'))
+ I18n.t('provider_accounts.errors.not_destroyable_deployments',
+ :deployments => not_destroyable_instances.
+ map{|i| i.deployment.name}.uniq.join(', '))
end
end
diff --git a/src/config/locales/en.yml b/src/config/locales/en.yml
index dc0266d..e1aaae0 100644
--- a/src/config/locales/en.yml
+++ b/src/config/locales/en.yml
@@ -1335,7 +1335,7 @@ en:
populate_hardware_profiles_failed: "Failed to populate hardware_profiles:
%{message}"
populate_realms_failed: "Failed to populate Realms: %{message}"
could_not_connect: "Could not connect to Provider Account. Please contact an
Administrator."
- not_destroyable_instances: "Can not destroy following instances:
%{instances}"
+ not_destroyable_deployments: "The following Deployments have not been stopped:
%{deployments}"
associated_images: "There are following associated provider images: %{images}.
Delete them first."
provider_priority_groups:
index:
diff --git a/src/features/step_definitions/provider_account_steps.rb
b/src/features/step_definitions/provider_account_steps.rb
index 74ac178..135a4bf 100644
--- a/src/features/step_definitions/provider_account_steps.rb
+++ b/src/features/step_definitions/provider_account_steps.rb
@@ -14,7 +14,8 @@
# limitations under the License.
#
Given /^the account has an instance associated with it$/ do
- FactoryGirl.create :instance, :provider_account => @provider_account
+ deployment = Factory.create(:deployment)
+ FactoryGirl.create :instance, :provider_account => @provider_account, :deployment
=> deployment
end
Given /^all the account instances are stopped$/ do
--
1.7.6.5