Skip to content

Commit

Permalink
Merge pull request #4014 from chloerh/hostname-xml
Browse files Browse the repository at this point in the history
network_xml:Update to support setting up hostname xmls with a list of hostname strings
  • Loading branch information
Yingshun authored Dec 11, 2024
2 parents 3260765 + 0945504 commit 80ca89f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions virttest/libvirt_xml/network_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,12 @@ def marshal_from_hostname(item, index, libvirtxml):
"""
if isinstance(item, DNSXML.HostnameXML):
return "hostname", item
elif isinstance(item, str):
elif isinstance(item, (dict, str)):
hostname = DNSXML.HostnameXML()
hostname.hostname = item
if isinstance(item, dict):
hostname.setup_attrs(**item)
else:
hostname.hostname = item
return "hostname", hostname
else:
raise xcepts.LibvirtXMLError(
Expand Down

0 comments on commit 80ca89f

Please sign in to comment.