Modify

Ticket #708 (closed defect: fixed)

Opened 14 years ago

Last modified 14 years ago

Empty Pkgmgr xml file prints traceback

Reported by: Joe Digilio <[email protected]…> Owned by: desai
Priority: minor Milestone: Bcfg2 1.0.0 Release
Component: bcfg2-server Version: 1.0
Keywords: Cc:

Description

If there is an empty xml file in the Pkgmgr directory, it prints a traceback instead of a proper error message:

# touch /srv/bcfg2/Pkgmgr/empty-file.xml
# bcfg2-repo-validate
Traceback (most recent call last):
 File "/usr/sbin/bcfg2-repo-validate", line 79, in <module>
   xdata = lxml.etree.parse(plist)
 File "etree.pyx", line 2045, in etree.parse
 File "parser.pxi", line 970, in etree._parseDocument
 File "parser.pxi", line 974, in etree._parseDocumentFromURL
 File "parser.pxi", line 891, in etree._parseDocFromFile
 File "parser.pxi", line 582, in etree._BaseParser._parseDocFromFile
 File "parser.pxi", line 656, in etree._handleParseResult
 File "parser.pxi", line 627, in etree._raiseParseError
etree.XMLSyntaxError: line 1: Start tag expected, '<' not found

I'm guessing it should do something more like this:

# touch /srv/bcfg2/Bundler/empty-file.xml
# bcfg2-repo-validate
/srv/bcfg2/Bundler/empty-file.xml ***FAILS*** to parse           <----
/srv/bcfg2/Bundler/empty-file.xml:1: parser error : Document is empty

^
/srv/bcfg2/Bundler/empty-file.xml:1: parser error : Start tag expected, '<' not found

^

Attachments

Change History

comment:1 Changed 14 years ago by solj

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

Should be fixed in [9b60636b5442775a2c61057a632f823efd39a7db] (SVN r5403). Thanks again :-).

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.