From 71854781376c49cf32bf7a7e476b8fbd26bae0fc Mon Sep 17 00:00:00 2001 From: Lucy Cifferello <12953208+elvece@users.noreply.github.com> Date: Mon, 4 Oct 2021 11:27:49 -0600 Subject: [PATCH] absolute path to package docker dir --- appmgr/src/install/mod.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/appmgr/src/install/mod.rs b/appmgr/src/install/mod.rs index d93524683..8688d9dbf 100644 --- a/appmgr/src/install/mod.rs +++ b/appmgr/src/install/mod.rs @@ -714,12 +714,13 @@ pub async fn install_s9pk( Ok(()) } -pub async fn load_images() -> Result<(), Error> { - if tokio::fs::metadata(PKG_DOCKER_DIR).await.is_ok() { - ReadDirStream::new(tokio::fs::read_dir(PKG_DOCKER_DIR).await?) +pub async fn load_images(ctx: RpcContext) -> Result<(), Error> { + let docker_dir = ctx.datadir.join(PKG_DOCKER_DIR); + if tokio::fs::metadata(&docker_dir).await.is_ok() { + ReadDirStream::new(tokio::fs::read_dir(&docker_dir).await?) .map_err(|e| { Error::new( - anyhow::Error::from(e).context(PKG_DOCKER_DIR), + anyhow::Error::from(e).context(format!("{:?}", &docker_dir)), crate::ErrorKind::Filesystem, ) })