mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-05-29 17:23:08 +00:00
Enhance sycnfile format
Support the new format 'file -> (noderange for permitted nodes) file' for syncfile.
This commit is contained in:
parent
d3efe413ad
commit
0f52e5f000
@ -20,6 +20,7 @@ require xCAT::DSHCore;
|
||||
use xCAT::MsgUtils;
|
||||
use xCAT::Utils;
|
||||
use xCAT::TableUtils;
|
||||
use xCAT::NodeRange;
|
||||
use lib '/opt/xcat/xdsh';
|
||||
our @dsh_available_contexts = ();
|
||||
our @dsh_valid_contexts = ();
|
||||
@ -5068,12 +5069,29 @@ sub parse_rsync_input_file_on_MN
|
||||
}
|
||||
} else { # not processing EXECUTE, EXECUTEALWAYS or APPEND
|
||||
# otherwise it is just the synclist
|
||||
if ($line =~ /(.+) -> (.+)/)
|
||||
{
|
||||
|
||||
# xCAT supports the syncfile format:
|
||||
# file -> file
|
||||
# file -> (noderange for permitted nodes) file
|
||||
if ($line =~ /(.+) -> (.+)/ || $line =~ /(.+) -> +\((.+)\) +(.+)/) {
|
||||
$::process_line = 1;
|
||||
my $src_file = $1;
|
||||
my $dest_file = $2;
|
||||
my $src_file;
|
||||
my $dest_file;
|
||||
my $dest_node;
|
||||
my @dest_nodes;
|
||||
if ($line =~ /(.+) -> +\((.+)\) +(.+)/) {
|
||||
$src_file = $1;
|
||||
$dest_node = $2;
|
||||
$dest_file = $3;
|
||||
} elsif ($line =~ /(.+) -> (.+)/) {
|
||||
$src_file = $1;
|
||||
$dest_file = $2;
|
||||
}
|
||||
|
||||
# get all the permitted nodes for the line
|
||||
$dest_node =~ s/\s//g;
|
||||
if ($dest_node) {
|
||||
@dest_nodes = noderange($dest_node);
|
||||
}
|
||||
$dest_file =~ s/[\s;]//g;
|
||||
my @srcfiles = (split ' ', $src_file);
|
||||
my $arraysize = scalar @srcfiles; # of source files on the line
|
||||
@ -5102,6 +5120,10 @@ sub parse_rsync_input_file_on_MN
|
||||
|
||||
foreach my $target_node (@dest_host)
|
||||
{
|
||||
# skip the node if it's NOT in the permitted list
|
||||
if ($dest_node && ! grep /^$target_node$/, @dest_nodes) {
|
||||
next;
|
||||
}
|
||||
$$options{'destDir_srcFile'}{$target_node} ||= {};
|
||||
|
||||
# for each file on the line
|
||||
|
Loading…
x
Reference in New Issue
Block a user