fix locker issues

This commit is contained in:
Aiden McClelland
2021-09-27 15:28:33 -06:00
committed by Aiden McClelland
parent d92bccdc45
commit 28c2965596
4 changed files with 17 additions and 7 deletions

View File

@@ -13,7 +13,9 @@ use crate::config::{Config, ConfigSpec};
use crate::context::RpcContext;
use crate::id::{Id, InvalidId};
use crate::s9pk::manifest::PackageId;
use crate::util::{IoFormat, ValuePrimative, Version, display_serializable, parse_stdin_deserializable};
use crate::util::{
display_serializable, parse_stdin_deserializable, IoFormat, ValuePrimative, Version,
};
use crate::volume::Volumes;
use crate::{Error, ResultExt};
@@ -80,7 +82,7 @@ pub enum ActionResult {
#[derive(Debug, Serialize, Deserialize)]
pub struct ActionResultV0 {
pub message: String,
pub value: ValuePrimative,
pub value: Option<String>,
pub copyable: bool,
pub qr: bool,
}
@@ -183,8 +185,12 @@ fn display_action_result(action_result: ActionResult, matches: &ArgMatches<'_>)
}
match action_result {
ActionResult::V0(ar) => {
println!("{}: {}", ar.message, serde_json::to_string(&ar.value).unwrap());
},
println!(
"{}: {}",
ar.message,
serde_json::to_string(&ar.value).unwrap()
);
}
}
}

View File

@@ -351,7 +351,8 @@ impl Manager {
.await
{
Err(bollard::errors::Error::DockerResponseNotFoundError { .. })
| Err(bollard::errors::Error::DockerResponseConflictError { .. }) => (), // Already stopped
| Err(bollard::errors::Error::DockerResponseConflictError { .. })
| Err(bollard::errors::Error::DockerResponseNotModifiedError { .. }) => (), // Already stopped
a => a?,
};
self.shared.status.store(
@@ -413,7 +414,8 @@ impl Manager {
.await
{
Err(bollard::errors::Error::DockerResponseNotFoundError { .. })
| Err(bollard::errors::Error::DockerResponseConflictError { .. }) => (),
| Err(bollard::errors::Error::DockerResponseConflictError { .. })
| Err(bollard::errors::Error::DockerResponseNotModifiedError { .. }) => (), // Already stopped
a => a?,
};
self.shared.status.store(

View File

@@ -301,7 +301,9 @@ impl MainStatus {
},
ManagerStatus::Running => match self {
MainStatus::Stopped | MainStatus::Stopping | MainStatus::Restoring { .. } => {
dbg!("stopping");
manager.stop().await?;
dbg!("stopped");
}
MainStatus::Running { .. } => (),
MainStatus::BackingUp { .. } => {