This patch fixes a duplicate error message issue having to do with a user having
insufficient permissions on a hwp, and Il8n's the error.
Mainn
Show replies by date
---
src/config/locales/en.yml | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/config/locales/en.yml b/src/config/locales/en.yml
index 4050e0b..6181d7e 100644
--- a/src/config/locales/en.yml
+++ b/src/config/locales/en.yml
@@ -274,6 +274,7 @@ en:
not_updated:
one: "The deployment %{list} could not be updated."
other: "The deployments %{list} could not be updated."
+ no_hwp_permission: "You do not have sufficient permission to access the
%{hwp} hardware profile."
success:
deleted:
one: "The deployment %{list} was scheduled for deletion."
--
1.7.6.5
---
src/app/models/deployment.rb | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/app/models/deployment.rb b/src/app/models/deployment.rb
index cd2eb73..35e92cb 100644
--- a/src/app/models/deployment.rb
+++ b/src/app/models/deployment.rb
@@ -287,7 +287,7 @@ class Deployment < ActiveRecord::Base
begin
deployable_xml.assemblies.each do |assembly|
hw_profile = permissioned_frontend_hwprofile(user, assembly.hwp)
- raise "Hardware Profile #{assembly.hwp} not found." unless hw_profile
+ raise I18n.t('deployments.flash.error.no_hwp_permission', :hwp =>
assembly.hwp) unless hw_profile
instance = Instance.new(
:deployment => self,
:name => "#{name}/#{assembly.name}",
@@ -321,7 +321,7 @@ class Deployment < ActiveRecord::Base
raise
Aeolus::Conductor::MultiError::UnlaunchableAssembly.new(I18n.t('deployments.flash.error.not_launched'),
deployment_errors)
end
rescue
- errs = $!.message
+ errs << $!.message
end
errs
end
@@ -523,7 +523,7 @@ class Deployment < ActiveRecord::Base
deployable_xml.assemblies.each do |assembly|
begin
hw_profile = permissioned_frontend_hwprofile(user, assembly.hwp)
- raise "Hardware Profile #{assembly.hwp} not found." unless hw_profile
+ raise I18n.t('deployments.flash.error.no_hwp_permission', :hwp =>
assembly.hwp) unless hw_profile
Instance.transaction do
instance = Instance.create!(
:deployment => self,
--
1.7.6.5