From ca27ff256a6ebf7d9327ee013fba3f43725c8b67 Mon Sep 17 00:00:00 2001 From: yangsbj Date: Tue, 12 Feb 2019 03:00:40 -0500 Subject: [PATCH] fix issue xdcp EXECUTE of .post script not working as expected #5987 --- perl-xCAT/xCAT/DSHCLI.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/DSHCLI.pm b/perl-xCAT/xCAT/DSHCLI.pm index 4284b4ef0..0aacbb3c5 100644 --- a/perl-xCAT/xCAT/DSHCLI.pm +++ b/perl-xCAT/xCAT/DSHCLI.pm @@ -5936,6 +5936,11 @@ sub run_rsync_postscripts # return from rsync is tmp/file1 not /tmp/file1 substr($tmppostfile, 0, 1) = ""; + # now remove .post from the postscript file for the compare + # with the returned file name + my($tp,$post) = split(/\.post/,$tmppostfile); + $tmppostfile = $tp; + foreach my $line (@rsync_output) { my ($hostname, $ps) = split(/: /, $line); chomp $ps; @@ -5948,7 +5953,11 @@ sub run_rsync_postscripts } next; } - if ($tmppostfile eq $ps) { + + #the $postsfile .post will be run if: + # the is updated, or + # the .post file is updated + if ($ps eq $tmppostfile or $ps eq $tmppostfile.".post" ) { # build xdsh queue # build host and all scripts to execute