diff --git a/pageserver/src/bin/pageserver.rs b/pageserver/src/bin/pageserver.rs index 4831dd955b..8905724839 100644 --- a/pageserver/src/bin/pageserver.rs +++ b/pageserver/src/bin/pageserver.rs @@ -64,10 +64,10 @@ fn main() -> Result<()> { .get_matches(); let workdir = Path::new(arg_matches.value_of("workdir").unwrap_or(".zenith")); - let cfg_file_path = workdir + let workdir = workdir .canonicalize() - .with_context(|| format!("Error opening workdir '{}'", workdir.display()))? - .join("pageserver.toml"); + .with_context(|| format!("Error opening workdir '{}'", workdir.display()))?; + let cfg_file_path = workdir.join("pageserver.toml"); let init = arg_matches.is_present("init"); let create_tenant = arg_matches.value_of("create-tenant"); @@ -119,7 +119,7 @@ fn main() -> Result<()> { } } trace!("Resulting toml: {}", toml); - let conf = PageServerConf::parse_and_validate(&toml, workdir) + let conf = PageServerConf::parse_and_validate(&toml, &workdir) .context("Failed to parse pageserver configuration")?; // The configuration is all set up now. Turn it into a 'static diff --git a/zenith/src/main.rs b/zenith/src/main.rs index 02a99b1c2a..d73ee8a297 100644 --- a/zenith/src/main.rs +++ b/zenith/src/main.rs @@ -32,8 +32,8 @@ fn default_conf() -> String { r#" # Default built-in configuration, defined in main.rs [pageserver] -listen_pg_addr = {pageserver_pg_addr} -listen_http_addr = {pageserver_http_addr} +listen_pg_addr = '{pageserver_pg_addr}' +listen_http_addr = '{pageserver_http_addr}' auth_type = '{pageserver_auth_type}' [[safekeepers]] diff --git a/zenith_utils/src/crashsafe_dir.rs b/zenith_utils/src/crashsafe_dir.rs index fcb4ddcce3..a7eab73a43 100644 --- a/zenith_utils/src/crashsafe_dir.rs +++ b/zenith_utils/src/crashsafe_dir.rs @@ -36,7 +36,7 @@ pub fn create_dir_all(path: impl AsRef) -> io::Result<()> { Ok(_) => { return Err(io::Error::new( io::ErrorKind::AlreadyExists, - format!("non-directory found in path: {:?}", path), + format!("non-directory found in path: {}", path.display()), )); } Err(ref e) if e.kind() == io::ErrorKind::NotFound => {} @@ -50,8 +50,8 @@ pub fn create_dir_all(path: impl AsRef) -> io::Result<()> { None => { return Err(io::Error::new( io::ErrorKind::InvalidInput, - "can't find parent", - )) + format!("can't find parent of path '{}'", path.display()).as_str(), + )); } } }