mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-24 23:25:24 +00:00
fix wvmInterface get_ipv4/6: xml_path should specify protocol family
This commit is contained in:
parent
a4bea0e765
commit
cdb5c4f412
1 changed files with 6 additions and 6 deletions
|
@ -81,7 +81,7 @@ class wvmInterface(wvmConnect):
|
||||||
def get_ipv4_type(self):
|
def get_ipv4_type(self):
|
||||||
try:
|
try:
|
||||||
xml = self._XMLDesc(VIR_INTERFACE_XML_INACTIVE)
|
xml = self._XMLDesc(VIR_INTERFACE_XML_INACTIVE)
|
||||||
ipaddr = util.get_xml_path(xml, "/interface/protocol/ip/@address")
|
ipaddr = util.get_xml_path(xml, "/interface/protocol[@family='ipv4']/ip/@address")
|
||||||
if ipaddr:
|
if ipaddr:
|
||||||
return 'static'
|
return 'static'
|
||||||
else:
|
else:
|
||||||
|
@ -91,8 +91,8 @@ class wvmInterface(wvmConnect):
|
||||||
|
|
||||||
def get_ipv4(self):
|
def get_ipv4(self):
|
||||||
xml = self._XMLDesc()
|
xml = self._XMLDesc()
|
||||||
int_ipv4_ip = util.get_xml_path(xml, "/interface/protocol/ip/@address")
|
int_ipv4_ip = util.get_xml_path(xml, "/interface/protocol[@family='ipv4']/ip/@address")
|
||||||
int_ipv4_mask = util.get_xml_path(xml, "/interface/protocol/ip/@prefix")
|
int_ipv4_mask = util.get_xml_path(xml, "/interface/protocol[@family='ipv4']/ip/@prefix")
|
||||||
if not int_ipv4_ip or not int_ipv4_mask:
|
if not int_ipv4_ip or not int_ipv4_mask:
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
|
@ -101,7 +101,7 @@ class wvmInterface(wvmConnect):
|
||||||
def get_ipv6_type(self):
|
def get_ipv6_type(self):
|
||||||
try:
|
try:
|
||||||
xml = self._XMLDesc(VIR_INTERFACE_XML_INACTIVE)
|
xml = self._XMLDesc(VIR_INTERFACE_XML_INACTIVE)
|
||||||
ipaddr = util.get_xml_path(xml, "/interface/protocol[2]/ip/@address")
|
ipaddr = util.get_xml_path(xml, "/interface/protocol[@family='ipv6']/ip/@address")
|
||||||
if ipaddr:
|
if ipaddr:
|
||||||
return 'static'
|
return 'static'
|
||||||
else:
|
else:
|
||||||
|
@ -111,8 +111,8 @@ class wvmInterface(wvmConnect):
|
||||||
|
|
||||||
def get_ipv6(self):
|
def get_ipv6(self):
|
||||||
xml = self._XMLDesc()
|
xml = self._XMLDesc()
|
||||||
int_ipv6_ip = util.get_xml_path(xml, "/interface/protocol[2]/ip/@address")
|
int_ipv6_ip = util.get_xml_path(xml, "/interface/protocol[@family='ipv6']/ip/@address")
|
||||||
int_ipv6_mask = util.get_xml_path(xml, "/interface/protocol[2]/ip/@prefix")
|
int_ipv6_mask = util.get_xml_path(xml, "/interface/protocol[@family='ipv6']/ip/@prefix")
|
||||||
if not int_ipv6_ip or not int_ipv6_mask:
|
if not int_ipv6_ip or not int_ipv6_mask:
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue