Bug 720406

Summary: aeolus-image should return a more user friendly error if template xml is not parsed.
Product: [Retired] CloudForms Cloud Engine Reporter: wes hayutin <whayutin>
Component: rubygem-aeolus-imageAssignee: Martyn Taylor <mtaylor>
Status: CLOSED CURRENTRELEASE QA Contact: wes hayutin <whayutin>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.3.1CC: akarol, dajohnso, morazi, ssachdev
Target Milestone: beta   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description wes hayutin 2011-07-11 15:08:07 UTC
Description of problem:

[root@sgi-xe310-02 ~]# aeolus-image build  --target vmware --template /root/templateRHEL61.tpl 
/usr/lib/ruby/gems/1.8/gems/aeolus-cli-0.0.1/lib/build_command.rb:31:in `run': undefined method `each' for #<Qmf2::QmfAgentException:0x7f0097f48168> (NoMethodError)
	from /usr/lib/ruby/gems/1.8/gems/aeolus-cli-0.0.1/lib/config_parser.rb:194:in `build'
	from /usr/lib/ruby/gems/1.8/gems/aeolus-cli-0.0.1/lib/config_parser.rb:30:in `send'
	from /usr/lib/ruby/gems/1.8/gems/aeolus-cli-0.0.1/lib/config_parser.rb:30:in `process'
	from /usr/lib/ruby/gems/1.8/gems/aeolus-cli-0.0.1/bin/aeolus-image:6
	from /usr/bin/aeolus-image:19:in `load'
	from /usr/bin/aeolus-image:19
2011-07-11 11:05:36 warning Connection [41713 localhost:5672] closed
[root@sgi-xe310-02 ~]# 


Actual error:


2011-07-11 11:05:34,128 DEBUG imagefactory.ImageWarehouse.ImageWarehouse pid(17904) Message: Created Image Warehouse instance http://localhost:9090 - buckets(target_images, templates, icicles, provider_images)
2011-07-11 11:05:34,129 ERROR imagefactory.qmfagent.ImageFactoryAgent.ImageFactoryAgent pid(17904) Message: xmlParseDoc() failed
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/imagefactory/qmfagent/ImageFactoryAgent.py", line 74, in method
    result = getattr(target_obj, methodName)(**args)
  File "/usr/lib/python2.6/site-packages/imagefactory/qmfagent/ImageFactory.py", line 122, in build_image
    return BuildDispatcher().build_image_for_targets(image, build, template, targets, BuildAdaptor, self.agent)
  File "/usr/lib/python2.6/site-packages/imagefactory/BuildDispatcher.py", line 51, in build_image_for_targets
    image_id = self._ensure_image_with_template(image_id, template)
  File "/usr/lib/python2.6/site-packages/imagefactory/BuildDispatcher.py", line 91, in _ensure_image_with_template
    name = self._xml_node(template.xml, '/template/name')
  File "/usr/lib/python2.6/site-packages/imagefactory/BuildDispatcher.py", line 85, in _xml_node
    nodes = libxml2.parseDoc(xml).xpathEval(xpath)
  File "/usr/lib64/python2.6/site-packages/libxml2.py", line 1263, in parseDoc
    if ret is None:raise parserError('xmlParseDoc() failed')
parserError: xmlParseDoc() failed



[root@sgi-xe310-02 ~]# rpm -qa |grep aeolus
aeolus-conductor-0.3.0-0.el6.20110708135911gitdb1097c.noarch
rubygem-aeolus-cli-0.0.1-1.el6.20110708135911gitdb1097c.noarch
aeolus-all-0.3.0-0.el6.20110708135911gitdb1097c.noarch
aeolus-conductor-doc-0.3.0-0.el6.20110708135911gitdb1097c.noarch
aeolus-configure-2.0.1-0.el6.20110708134115gitab1e6dc.noarch
aeolus-conductor-daemons-0.3.0-0.el6.20110708135911gitdb1097c.noarch

Comment 1 Martyn Taylor 2011-07-18 15:40:59 UTC
commit 26203d19fc95a43ad2f5989d4276393f0e1b6b3d
Author: Martyn Taylor <mtaylor>
Date:   Wed Jul 13 13:01:53 2011 +0100

    BZ#720406 Added validate xml against template schema check

Comment 2 Aziza Karol 2011-07-27 12:20:43 UTC
Template validation check done.

[root@hp-bl480c-01 templates]# aeolus-image build --target rhevm --template  fedora.tpl 
ERROR: The given Template does not conform to the TDL Schema, see below for specific details:
- Element template has extra content: template


Following is the template used:
verified by removing some slashes from the template

<?xml version="1.0"?>
<template>
  <name>shveta_vmware</name>
  <description>desc</description>
  <os>
    <name>Fedora</name>
    <arch>x86_64</arch>
    <version>14</version>
    <install type="url">
      <url>http://download.fedoraproject.org/pub/fedora/linux/releases/14/Fedora/x86_64/os/</url>
    </install>
  </os>
  <repositories>
    <repository name="custom">
      <url>http://repos.fedorapeople.org/repos/aeolus/demo/webapp/</url>
      <signed>false</signed>
    </repository>
  </repositories>
<template>

[root@hp-bl480c-01 templates]# rpm -qa  | grep aeolus
aeolus-conductor-doc-0.3.0-3.el6.noarch
aeolus-conductor-0.3.0-3.el6.noarch
rubygem-aeolus-image-0.0.1-3.el6.noarch
aeolus-all-0.3.0-2.el6.noarch
aeolus-conductor-daemons-0.3.0-3.el6.noarch
aeolus-configure-2.0.1-2.el6.noarch

Comment 3 wes hayutin 2011-08-01 19:48:50 UTC
removing from tracker

Comment 4 wes hayutin 2011-08-01 20:01:00 UTC
release pending...

Comment 5 wes hayutin 2011-08-01 20:01:03 UTC
release pending...

Comment 6 wes hayutin 2011-08-01 20:01:31 UTC
release pending.. 2

Comment 8 wes hayutin 2011-12-08 14:00:01 UTC
perm close

Comment 9 wes hayutin 2011-12-08 14:02:46 UTC
closing out old bugs