update functionality for the brain #2
@ -272,9 +272,9 @@ impl BrainData {
|
|||||||
mut req: grpc::NewVmReq,
|
mut req: grpc::NewVmReq,
|
||||||
tx: OneshotSender<grpc::NewVmResp>,
|
tx: OneshotSender<grpc::NewVmResp>,
|
||||||
) {
|
) {
|
||||||
let uuid = uuid::Uuid::new_v4().to_string();
|
if req.uuid.is_empty() {
|
||||||
|
req.uuid = uuid::Uuid::new_v4().to_string();
|
||||||
req.uuid = uuid.clone();
|
}
|
||||||
info!("Inserting new vm request in memory: {req:?}");
|
info!("Inserting new vm request in memory: {req:?}");
|
||||||
self.tmp_newvm_reqs
|
self.tmp_newvm_reqs
|
||||||
.insert(req.uuid.clone(), (req.clone(), tx));
|
.insert(req.uuid.clone(), (req.clone(), tx));
|
||||||
@ -292,7 +292,7 @@ impl BrainData {
|
|||||||
);
|
);
|
||||||
self.submit_newvm_resp(grpc::NewVmResp {
|
self.submit_newvm_resp(grpc::NewVmResp {
|
||||||
error: "Daemon is offline.".to_string(),
|
error: "Daemon is offline.".to_string(),
|
||||||
uuid,
|
uuid: req.uuid,
|
||||||
exposed_ports: Vec::new(),
|
exposed_ports: Vec::new(),
|
||||||
ovmf_hash: "".to_string(),
|
ovmf_hash: "".to_string(),
|
||||||
ips: Vec::new(),
|
ips: Vec::new(),
|
||||||
|
Loading…
Reference in New Issue
Block a user