Can define bridge name

This commit is contained in:
2023-12-19 18:11:53 +01:00
parent afebe97395
commit e969455c58
5 changed files with 46 additions and 4 deletions

View File

@ -71,7 +71,15 @@ pub async fn update(
path: web::Path<NetworkID>,
body: web::Json<NetworkInfo>,
) -> HttpResult {
let mut network = body.0.to_virt_network()?;
let mut network = match body.0.to_virt_network() {
Ok(n) => n,
Err(e) => {
log::error!("Failed to extract network info! {e}");
return Ok(
HttpResponse::BadRequest().json(format!("Failed to extract network info!\n${e}"))
);
}
};
network.uuid = Some(path.uid);
if let Err(e) = client.update_network(network).await {