=Comment: #0================================================= PAVAN NAREGUNDI <pavan.naregundi.com> - screenshot of error message On Fedora12 rawhide ncftool is failing to define a new interface. error was as shown below =============== ncftool> define /tmp/eth.xml error: XML invalid error: Element interface has extra content: mac =============== XML for new interface: # cat eth.xml <interface type="ethernet" name="eth0"> <start mode="onboot"/> <mac address="00:1A:64:52:30:22"/> <protocol family="ipv4"> <ip address="9.126.89.111" prefix="24"/> <route gateway="9.126.89.1"/> </protocol> </interface> steps to reproduce: 1. take a backup of /etc/sysconfig/network-scripts/ifcfg-* files 2. execute the commands as below, # ncftool ncftool> ifdown eth0 ncftool> undefine eth0 ncftool> list ncftool> define /tmp/eth.xml Packages: netcf-0.1.0-3.fc12.x86_64 # uname -a Linux mx3950.in.ibm.com 2.6.31-14.fc12.x86_64 #1 SMP Tue Sep 15 03:48:57 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux Machine: x3950 Attaching the screen shot of the error =Comment: #1================================================= KAMALESH BABULAL <kamaleshb.com> - The ifcfg-eth0 is DEVICE=eth0 BOOTPROTO=static BROADCAST=9.126.89.255 DNS1=9.184.192.240 GATEWAY=9.126.89.1 HWADDR=00:1A:64:52:30:22 IPADDR=9.126.89.111 NETMASK=255.255.255.0 ONBOOT=yes After debugging it looks like cmd_define |_ncf_define |_drv_define |_void rng_validate(struct netcf *ncf, xmlDocPtr doc) { xmlRelaxNGValidCtxtPtr ctxt; int r; ctxt = xmlRelaxNGNewValidCtxt(ncf->driver->rng); xmlRelaxNGSetValidErrors(ctxt, rng_error, rng_error, ncf); r = xmlRelaxNGValidateDoc(ctxt, doc); <-- Return value is 1 The xml validation fails, with the return code 1
Created attachment 362476 [details] screenshot of error message
I can't reproduce this error, neither with netcf-0.1.0 nor netcf-0.1.1. Can you run 'xmllint -relaxng /usr/share/netcf/xml/interface.rng /tmp/eth.xml' on your machine ? Also, do you still get this error when you update to netcf-0.1.1 ?
------- Comment From kamaleshb.com 2009-09-25 01:47 EDT------- netcf packages installed on the box were # rpm -qa|grep -ia netcf netcf-0.1.0-3.fc12.x86_64 netcf-libs-0.1.0-3.fc12.x86_64 netcf-debuginfo-0.1.1-1.fc12.x86_64 Linux mx3950.in.ibm.com 2.6.31-14.fc12.x86_64 #1 SMP Tue Sep 15 03:48:57 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux result of xmllint with default interface.rng installed with netcf-0.1.0-3 # xmllint -relaxng /usr/share/netcf/xml/interface.rng /tmp/eth.xml <?xml version="1.0"?> /tmp/eth.xml:3: element mac: Relax-NG validity error : Element interface has extra content: mac /tmp/eth.xml:1: element interface: Relax-NG validity error : Element interface failed to validate attributes /tmp/eth.xml:3: element mac: Relax-NG validity error : Did not expect element mac there /tmp/eth.xml fails to validate After copying the interface.rng from netcf-0.1.1 to /usr/share/netcf/xml/ the validation was successful # xmllint -relaxng /usr/share/netcf/xml/interface.rng /tmp/eth.xml <?xml version="1.0"?> <interface type="ethernet" name="eth0"> <start mode="onboot"/> <mac address="00:1A:64:52:30:22"/> <protocol family="ipv4"> <ip address="9.126.89.111" prefix="24"/> <route gateway="9.126.89.1"/> </protocol> </interface> /tmp/eth.xml validates It works fine after upgrading to the newer packages netcf-libs-0.1.1-1.fc12.x86_64 netcf-0.1.1-1.fc12.x86_64 netcf-devel-0.1.1-1.fc12.x86_64 netcf-debuginfo-0.1.1-1.fc12.x86_64 btw, there is difference in the ifcfg-* file ncftool writes default ifcfg-eth0 file ------------------------------------------ dumpxml of eth0 ---------------------------- ncftool> dumpxml eth0 <?xml version="1.0"?> <interface type="ethernet" name="eth0"> <start mode="onboot"/> <mac address="00:1A:64:52:30:22"/> <protocol family="ipv4"> <ip address="9.126.89.111" prefix="24"/> <route gateway="9.126.89.1"/> </protocol> </interface> which results in the ifcfg-eth0 file DEVICE=eth0 HWADDR=00:1A:64:52:30:22 ONBOOT=yes BOOTPROTO=none IPADDR=9.126.89.111 NETMASK=255.255.255.0 GATEWAY=9.126.89.1 there are some configurations, which are being removed by ncftool. Is this the expected behavior of ncftool ?
Ok, I am glad you could resolve the XML schema issue. The differences in the ifcfg-eth0 file between what you had before and what netcf generated are (1) BROADCAST, which is deprecated and (2) DNS1 which is not supported by the netcf XML (yet) If you need support for explicitly setting nameservers, please file a feature request for netcf.