Skip to content

Commit

Permalink
fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
problame committed May 4, 2024
1 parent 6bcb095 commit a52b563
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions pageserver/src/bin/pageserver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ fn initialize_config(

let file_contents: Option<toml_edit::Document> = match std::fs::File::open(cfg_file_path) {
Ok(mut f) => {
if init {
anyhow::bail!("config file already exists: {cfg_file_path}");
}
let md = f.metadata().context("stat config file")?;
if md.is_file() {
let mut s = String::new();
Expand Down
3 changes: 1 addition & 2 deletions test_runner/regress/test_pageserver_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from fixtures.utils import wait_until


# test that we cannot override node id after init
def test_pageserver_init_node_id(
neon_simple_env: NeonEnv, neon_binpath: Path, pg_distrib_dir: Path
):
Expand Down Expand Up @@ -49,7 +48,7 @@ def run_pageserver(args):

bad_reinit = run_pageserver(good_init_cmd)
assert bad_reinit.returncode == 1, "pageserver refuses to init if already exists"
assert "already exists, cannot init it" in bad_reinit.stderr
assert "config file already exists" in bad_reinit.stderr


def check_client(env: NeonEnv, client: PageserverHttpClient):
Expand Down

0 comments on commit a52b563

Please sign in to comment.