persist hostname in config overlay (#2769)

* persist hostname

* add migration

* fix version mismatch

* remove dmesg logging from build
This commit is contained in:
Aiden McClelland
2024-10-30 12:55:36 -06:00
committed by GitHub
parent 480f5c1a9a
commit 2091abeea2
17 changed files with 105 additions and 73 deletions

View File

@@ -923,6 +923,20 @@ pub async fn create_file(path: impl AsRef<Path>) -> Result<File, Error> {
.with_ctx(|_| (ErrorKind::Filesystem, lazy_format!("create {path:?}")))
}
pub async fn delete_file(path: impl AsRef<Path>) -> Result<(), Error> {
let path = path.as_ref();
tokio::fs::remove_file(path)
.await
.or_else(|e| {
if e.kind() == std::io::ErrorKind::NotFound {
Ok(())
} else {
Err(e)
}
})
.with_ctx(|_| (ErrorKind::Filesystem, lazy_format!("delete {path:?}")))
}
pub async fn rename(src: impl AsRef<Path>, dst: impl AsRef<Path>) -> Result<(), Error> {
let src = src.as_ref();
let dst = dst.as_ref();