From 716b7edd3370272c595b987c271b6314e39c4101 Mon Sep 17 00:00:00 2001 From: Ramil_Algayev Date: Fri, 3 Jan 2025 18:23:29 +0400 Subject: [PATCH] Had to change these so that the updater could work. I'm not sure if this is the best way to do it, but it works for now. --- src/data.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/data.rs b/src/data.rs index f0c4de3..4b0c522 100644 --- a/src/data.rs +++ b/src/data.rs @@ -272,9 +272,9 @@ impl BrainData { mut req: grpc::NewVmReq, tx: OneshotSender, ) { - let uuid = uuid::Uuid::new_v4().to_string(); - - req.uuid = uuid.clone(); + if req.uuid.is_empty() { + req.uuid = uuid::Uuid::new_v4().to_string(); + } info!("Inserting new vm request in memory: {req:?}"); self.tmp_newvm_reqs .insert(req.uuid.clone(), (req.clone(), tx)); @@ -292,7 +292,7 @@ impl BrainData { ); self.submit_newvm_resp(grpc::NewVmResp { error: "Daemon is offline.".to_string(), - uuid, + uuid: req.uuid, exposed_ports: Vec::new(), ovmf_hash: "".to_string(), ips: Vec::new(),