fix: create data directory after sanity check

This commit is contained in:
Christian Kruse
2014-01-07 14:42:55 +01:00
parent 7428e92e10
commit d0f3cb59c7

View File

@@ -1500,14 +1500,6 @@ do_witness_create(void)
char master_hba_file[MAXLEN];
/* Check this directory could be used as a PGDATA dir */
if (!create_pgdir(runtime_options.dest_dir, runtime_options.force))
{
log_err(_("witness create: couldn't create data directory (\"%s\") for witness"),
runtime_options.dest_dir);
exit(ERR_BAD_CONFIG);
}
/* Connection parameters for master only */
keywords[0] = "host";
values[0] = runtime_options.host;
@@ -1549,6 +1541,15 @@ do_witness_create(void)
exit(ERR_BAD_SSH);
}
/* Check this directory could be used as a PGDATA dir */
if (!create_pgdir(runtime_options.dest_dir, runtime_options.force))
{
log_err(_("witness create: couldn't create data directory (\"%s\") for witness"),
runtime_options.dest_dir);
exit(ERR_BAD_CONFIG);
}
/*
* To create a witness server we need to:
* 1) initialize the cluster