Modify

Ticket #495 (closed enhancement: worksforme)

Opened 16 years ago

Last modified 15 years ago

Need to improve error message for malformed Pkgmgr xml

Reported by: labrown Owned by: desai
Priority: minor Milestone:
Component: bcfg2-server Version: 0.9.x
Keywords: validator Cc:

Description

pkgmgr_gen.py can be used to generate Pkgmgr xml that looks like:

<PackageList? uri='http://lib.stat.cmu.edu/R/CRAN/bin/linux/redhat/el5/x86_64/' priority='0' type='yum'>

<Package name='R' type='yum'>

<Instance epoch='2' version='2.6.0' release='3.rh5' arch='x86_64'/>

</Package> <Package name='R-devel' type='yum'>

<Instance epoch='2' version='2.6.0' release='3.rh5' arch='x86_64'/>

</Package> <Package name='libRmath' type='yum'>

<Instance epoch='2' version='2.6.0' release='3.rh5' arch='x86_64'/>

</Package> <Package name='libRmath-devel' type='yum'>

<Instance epoch='2' version='2.6.0' release='3.rh5' arch='x86_64'/>

</Package>

</PackageList?>

This looks well-formed but is not and generates the following error when the validator is run:

/var/lib/bcfg2/Pkgmgr/r-project.xml *FAILS* to verify <---- /var/lib/bcfg2/Pkgmgr/r-project.xml:1: element PackageList?: Schemas validity error : Element 'PackageList?' [CT local]: The element content is not valid. /var/lib/bcfg2/Pkgmgr/r-project.xml fails to validate

PackageList? must include a ContainerType? element of some sort in order to be proper.

Enhancement: Improve error message to communicate this requirement.

Attachments

Change History

comment:1 Changed 15 years ago by desai

  • Status changed from new to closed
  • Resolution set to worksforme

I think this is an artifact of using an old version of libxml2. Using a new version, I get a more informative message:

/home/desai/tmp/bcfg2/Pkgmgr/x.xml ***FAILS*** to verify                <----
/home/desai/tmp/bcfg2/Pkgmgr/x.xml:2: element Package: Schemas validity error : Element 'Package': This element is not expected. Expected is ( Group ).
/home/desai/tmp/bcfg2/Pkgmgr/x.xml fails to validate

I am going to close this out for now.

WARNING! You need to establish a session before you can create or edit tickets. Otherwise the ticket will get treated as spam.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.