Use quick-xml to serialize network definitions

This commit is contained in:
2024-01-02 14:31:34 +01:00
parent e638829da7
commit 9256b76495
3 changed files with 22 additions and 71 deletions

View File

@ -123,7 +123,7 @@ impl NetworkInfo {
.hosts
.iter()
.map(|c| NetworkDHCPHostXML {
mac: c.mac.to_string(),
mac: Some(c.mac.to_string()),
name: c.name.to_string(),
ip: c.ip.into(),
})
@ -150,7 +150,7 @@ impl NetworkInfo {
.hosts
.iter()
.map(|h| NetworkDHCPHostXML {
mac: "".to_string(),
mac: None,
name: h.name.to_string(),
ip: h.ip.into(),
})
@ -221,7 +221,7 @@ impl NetworkInfo {
.hosts
.iter()
.map(|h| DHCPv4HostReservation {
mac: h.mac.to_string(),
mac: h.mac.clone().unwrap_or_default(),
name: h.name.to_string(),
ip: extract_ipv4(h.ip),
})