[PATCH conductor] BZ 813147 - fixed validation message displayed for invalid XML

jprovazn at redhat.com jprovazn at redhat.com
Thu Aug 30 12:43:14 UTC 2012


From: Jan Provaznik <jprovazn at redhat.com>

Also fixes assemblies method - if root node doesn't exist, empty
array is returned - w/o this an exception was raised in validation
process when checking cyclic references.
---
 src/app/util/deployable_xml.rb | 1 +
 src/config/locales/en.yml      | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/app/util/deployable_xml.rb b/src/app/util/deployable_xml.rb
index cb01cf5..e057771 100644
--- a/src/app/util/deployable_xml.rb
+++ b/src/app/util/deployable_xml.rb
@@ -257,6 +257,7 @@ class DeployableXML
   end
 
   def assemblies
+    return [] unless @root
     @assemblies ||=
       @root.xpath('/deployable/assemblies/assembly').collect do |assembly_node|
         AssemblyXML.new(assembly_node)
diff --git a/src/config/locales/en.yml b/src/config/locales/en.yml
index 0faa9db..d5da69f 100644
--- a/src/config/locales/en.yml
+++ b/src/config/locales/en.yml
@@ -842,8 +842,8 @@ en:
       warning:
         not_valid_or_reachable: "Deployable XML file is either invalid or no longer reachable at %{url}"
         no_url_provided: "No URL provided for the Deployable XML file."
-        not_valid: "The Deployable XML file contains syntax errors"
-        not_valid_duplicate_assembly_names: "Deployable XML must contain unique Assembly names"
+        not_valid: "file contains syntax errors"
+        not_valid_duplicate_assembly_names: "must contain unique Assembly names"
         not_valid_cyclic_reference: "Contains cyclic reference between following Assemblies or services: %{reference}"
         not_valid_not_existing_assembly_reference: "Assembly %{from_assembly}, service %{from_service}, parameter %{from_param} references not existing Assembly %{to_assembly}"
         not_valid_not_existing_service_reference: "Assembly %{from_assembly}, service %{from_service}, parameter %{from_param} references not existing Assembly %{to_assembly}, service %{to_service}"
-- 
1.7.11.4




More information about the aeolus-devel mailing list