On 05/17/2012 04:49 PM, Jan Provaznik wrote:
On 05/03/2012 01:22 PM, mzatko(a)redhat.com wrote:
> From: Maros Zatko<mzatko(a)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@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
Thank you for your review.
Template xml is text/xml, it came from outside world, so it has to be
wrapped as non safe data.
Clearly you can't guarantee consistency of outside world. When your
template xml gets corrupted,
you end up with non deterministic behavior of nokogiri which results in
non deterministic choice of
error message (those represents one of six (iirc) possible states
possibly implied by order of keys in
hash and resulting nokogiri's inability to chew input xml).
And also, this patch consists of two parts - the second applies to
conductor.
[PATCH conductor] BZ815357: display correct msg when using wrong tpl file
Again, thanks for your time
- maros