From 5db248d14eaf77f1205cdec6c921ad11104e4fa0 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Thu, 10 May 2018 04:34:09 -0400 Subject: [PATCH 1/2] Force chain to be standby if only runcmd/ondiscover is specified for chain attribute --- xCAT-server/lib/xcat/plugins/destiny.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index 3cc38c86c..6890a63bc 100755 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -848,6 +848,10 @@ sub nextdestiny { } unless ($ref->{currchain}) { #If no current chain, copy the default $ref->{currchain} = $ref->{chain}; + } else { + if ($ref->{currstate} and ($ref->{currstate} eq $ref->{currchain})) { + $ref->{currchain} = 'standby'; + } } my @chain = split /[,;]/, $ref->{currchain}; From 1f401f395238431bcd81544e1515e4d8bfb7dd4c Mon Sep 17 00:00:00 2001 From: ertaozh Date: Fri, 11 May 2018 03:50:25 -0400 Subject: [PATCH 2/2] Refine the PR in case ondiscover=xxx can not be fully set to currstate --- xCAT-server/lib/xcat/plugins/destiny.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index 6890a63bc..69c233ebf 100755 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -848,9 +848,10 @@ sub nextdestiny { } unless ($ref->{currchain}) { #If no current chain, copy the default $ref->{currchain} = $ref->{chain}; - } else { - if ($ref->{currstate} and ($ref->{currstate} eq $ref->{currchain})) { + } elsif ($ref->{currchain} !~ /[,;]/){ + if ($ref->{currstate} and ($ref->{currchain} =~ /$ref->{currstate}/)) { $ref->{currchain} = 'standby'; + $callnodeset = 0; } } my @chain = split /[,;]/, $ref->{currchain};