[PATCH] BZ815357: buildcmd: surround template xml with CDATA

Jan Provaznik jprovazn at redhat.com
Thu May 17 14:49:10 UTC 2012


On 05/03/2012 01:22 PM, mzatko at redhat.com wrote:
> From: Maros Zatko<mzatko at redhat.com>
>
> ---
>   lib/aeolus_cli/command/build_command.rb |    5 ++++-
>   1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/lib/aeolus_cli/command/build_command.rb b/lib/aeolus_cli/command/build_command.rb
> index 32b2c73..53d4abc 100644
> --- a/lib/aeolus_cli/command/build_command.rb
> +++ b/lib/aeolus_cli/command/build_command.rb
> @@ -34,7 +34,10 @@ module Aeolus
>             begin
>               template = read_template
>               validate_xml_schema(template)
> -            image = Aeolus::CLI::Image.new({:targets =>  @options[:target] * ",", :tdl =>  template, :environment =>  @options[:environment]})
> +            image = Aeolus::CLI::Image.new({
> +                :targets =>  @options[:target] * ",",
> +                :tdl =>  "<![CDATA[#{template}]]>",
> +                :environment =>  @options[:environment]})
>               image.save!
>
>               headers = ActiveSupport::OrderedHash.new

Hi,
even after applying whole patchset i'm still getting same result:

[jprovazn at localhost src]$ aeolus-image build -e ~/template.xml -T mock 
-E default --no-validation

ERROR:  ParameterDataIncorrect => Invalid template: XML is not valid:, 
Internal error: no state, Name is not set.

It's not clear to me how wrapping in CDATA might help.
Also not sure if '--no-validation' should even exist - once a build 
request is passed to conductor's controller, the template is saved in 
warehouse first, then build request is sent to imagefactory. This 
implies that the broken template is saved in warehouse - I believe we 
don't want to do this. Also current code is not ready for this.

I would suggest drop --no-validation param if possible.

Jan



More information about the aeolus-devel mailing list