Red Hat Bugzilla – Bug 1436300
update interface.rng to match the same file in libvirt
Last modified: 2017-08-01 17:46:42 EDT
+++ This bug was initially created as a clone of Bug #1414404 +++ The <start mode='blah'/> element in an interfact definition should be optional, but isn't. libvirt's RNG (schema for the XML) has been modified to make <start> optional (See Bug 1414404), and netcf needs to be modified in the same manner. This is the libvirt patch: https://www.redhat.com/archives/libvir-list/2017-March/msg01262.html And this is the netcf patch: https://lists.fedorahosted.org/archives/list/netcf-devel@lists.fedorahosted.org/thread/OCLPQ2WBSH7NPCHTYSWTCIVQ6QVWAUIR/
This is the upstream commit: commit 1b76d1d0a027f933f79cb250fc461488ab7ccfe4 Author: Laine Stump <laine@laine.org> Date: Mon Mar 27 00:49:09 2017 -0400 make <start mode='blah'/> optional
Resolved in this RHEL7.4-candidate build: https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=546862
Reproduce it on netcf-0.2.8-2.el7.x86_64 get a xml dumped by ncftool with startmode, then delete it the startmode, the ncftool can not validate it 1. the interface xml dumped by ncftool will always have startmode element # ncftool dumpxml enp0s25 > /tmp/net # cat /tmp/net <?xml version="1.0"?> <interface type="ethernet" name="enp0s25"> <start mode="none"/> <mac address="1c:6f:65:06:bc:81"/> <protocol family="ipv4"> <dhcp/> </protocol> </interface> 2. delete the startmode in /tmp/net # vim /tmp/net # cat /tmp/net <?xml version="1.0"?> <interface type="ethernet" name="enp0s25"> <mac address="1c:6f:65:06:bc:81"/> <protocol family="ipv4"> <dhcp/> </protocol> </interface> 3. netcf can not validate this xml # ncftool define /tmp/net error: XML invalid error: Expecting an element start, got nothing update to netcf-0.2.8-4.el7.x86_64 4. # ncftool define /tmp/net Defined interface enp0s25 The ethernet-interface, vlan-interface, bridge-interface, bond-interface will refer to "startmode" # cat /usr/share/netcf/xml/interface.rng ... 280 <define name="startmode"> 281 <optional> 282 <element name="start"> 283 <attribute name="mode"> 284 <choice> 285 <value>onboot</value> 286 <value>none</value> 287 <value>hotplug</value> 288 <!-- Jim Fehlig lists the following that SuSe supports: 289 manual, ifplug, nfsroot --> 290 </choice> 291 </attribute> 292 </element> 293 </optional> 294 </define> ....
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:2220