2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-09-06 02:08:25 +00:00

Merge branch 'lenovobuild2.14' of github.com:jjohnson42/xcat-core into lenovobuild2.14

This commit is contained in:
Jarrod Johnson
2019-04-08 15:17:13 -04:00
2 changed files with 27 additions and 9 deletions

View File

@@ -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,10 @@ sub run_rsync_postscripts
}
next;
}
if ($tmppostfile eq $ps) {
#the $postsfile <file>.post will be run if:
# the <file> is updated, or
if ($ps eq $tmppostfile ) {
# build xdsh queue
# build host and all scripts to execute

View File

@@ -158,23 +158,33 @@ end
start:updatenode_syncfile_EXECUTE
label:others,updatenode
cmd:echo "echo hello > /tmp/test" > /tmp/file.post
cmd:mkdir -p /tmp/updatenode_syncfile_EXECUTE/
check:rc==0
cmd:chmod a+x /tmp/file.post
cmd:echo "/tmp/file.post -> /tmp/file.post" > /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist
cmd:echo "EXECUTE:" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist
cmd:echo "/tmp/file.post" >> /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist
cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists=/install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist
cmd:touch /tmp/updatenode_syncfile_EXECUTE/file
check:rc==0
cmd:echo "echo hello > /tmp/test" > /tmp/updatenode_syncfile_EXECUTE/file.post
check:rc==0
cmd:chmod a+x /tmp/updatenode_syncfile_EXECUTE/file.post
cmd:echo "/tmp/updatenode_syncfile_EXECUTE/file -> /tmp/file" > /tmp/updatenode_syncfile_EXECUTE/synclist
cmd:echo "EXECUTE:" >> /tmp/updatenode_syncfile_EXECUTE/synclist
cmd:echo "/tmp/updatenode_syncfile_EXECUTE/file.post" >> /tmp/updatenode_syncfile_EXECUTE/synclist
cmd:chdef -t osimage -o __GETNODEATTR($$CN,provmethod)__ synclists=/tmp/updatenode_syncfile_EXECUTE/synclist
check:rc==0
cmd:updatenode $$CN -F
check:rc==0
cmd:xdsh $$CN "cat /tmp/test"
check:rc==0
check:output=~hello
cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists=
cmd:xdsh $$CN "rm -rf /tmp/test"
cmd:updatenode $$CN -F
check:rc==0
cmd:rm -rf /install/custom/install/__GETNODEATTR($$CN,os)__/compute.$$OS.synclist
cmd:xdsh $$CN "cat /tmp/test"
check:rc!=0
check:output=~No such file or directory
cmd:xdsh $$CN "rm -rf /tmp/test"
cmd:chdef -t osimage -o __GETNODEATTR($$CN,provmethod)__ synclists=
check:rc==0
cmd:rm -rf /tmp/updatenode_syncfile_EXECUTE/
end
start:updatenode_syncfile_EXECUTEALWAYS