network: Fix parsing route netmask

This commit is contained in:
Cole Robinson 2013-09-23 09:10:43 -04:00
parent a7b1414dc5
commit 0323fcfbf7
3 changed files with 14 additions and 0 deletions

View File

@ -698,6 +698,17 @@
</ip> </ip>
</network> </network>
<network ipv6='yes'>
<name>ipv6route</name>
<domain name='bar' />
<forward mode='route' dev='eth1'/>
<ip family='ipv6' address='fd00:db8:ac10:fd01::1' prefix='64'>
<dhcp>
<range start='fd00:db8:ac10:fd01::100' end='fd00:db8:ac10:fd01::1ff'/>
</dhcp>
</ip>
<route family='ipv6' address='fd00:db8:ac10:fd00::' prefix='64' gateway='fd00:db8:ac10:fd01::1' />
</network>

View File

@ -1041,6 +1041,8 @@ class XMLParseTest(unittest.TestCase):
check("prefix", 64, 63) check("prefix", 64, 63)
net.add_route("192.168.8.0", "24", "192.168.8.10") net.add_route("192.168.8.0", "24", "192.168.8.10")
check = self._make_checker(net.routes[0])
check("netmask", None, "foo", None)
utils.diff_compare(net.get_xml_config(), outfile) utils.diff_compare(net.get_xml_config(), outfile)
utils.test_create(conn, net.get_xml_config(), "networkDefineXML") utils.test_create(conn, net.get_xml_config(), "networkDefineXML")

View File

@ -62,6 +62,7 @@ class _NetworkRoute(XMLBuilder):
address = XMLProperty("./@address") address = XMLProperty("./@address")
prefix = XMLProperty("./@prefix", is_int=True) prefix = XMLProperty("./@prefix", is_int=True)
gateway = XMLProperty("./@gateway") gateway = XMLProperty("./@gateway")
netmask = XMLProperty("./@netmask")
class _NetworkForward(XMLBuilder): class _NetworkForward(XMLBuilder):