Fix zenith init defaults

This commit is contained in:
Kirill Bulatov
2021-12-27 18:59:17 +02:00
committed by Kirill Bulatov
parent b494ac1ea0
commit f0afd08667
3 changed files with 9 additions and 9 deletions

View File

@@ -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

View File

@@ -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]]

View File

@@ -36,7 +36,7 @@ pub fn create_dir_all(path: impl AsRef<Path>) -> 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<Path>) -> 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(),
));
}
}
}