mirror of https://github.com/schoebel/mars
marsadm: fix --force for switching to secondary
This commit is contained in:
parent
9272780a32
commit
c47d55cc49
|
@ -783,7 +783,7 @@ sub primary_res {
|
||||||
my $pri = "$mars/resource-$res/primary";
|
my $pri = "$mars/resource-$res/primary";
|
||||||
my $old = readlink($pri) or ldie "cannot determine current primary\n";
|
my $old = readlink($pri) or ldie "cannot determine current primary\n";
|
||||||
if($sec) {
|
if($sec) {
|
||||||
ldie "for safety reasons, switching to secondary is only allowed when I ($host) am primary\n" if($old ne $host);
|
ldie "for safety reasons, switching to secondary is only allowed when I ($host) am primary\n" if ($old ne $host) && !$force;
|
||||||
$host = "(none)";
|
$host = "(none)";
|
||||||
} elsif($old eq $host) {
|
} elsif($old eq $host) {
|
||||||
lprint "I am already primary.\n";
|
lprint "I am already primary.\n";
|
||||||
|
|
Loading…
Reference in New Issue