mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-08-18 01:00:23 +00:00
add support for skiptables
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9698 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
@@ -42,6 +42,13 @@ if ($? != 0)
|
||||
xCAT::MsgUtils->message("E", $msg);
|
||||
exit 1;
|
||||
}
|
||||
# read tables to skip during restore from site.skiptables attribute
|
||||
my @output2=xCAT::Utils->get_site_attribute('skiptables');
|
||||
my @skiptbls;
|
||||
if (@output2) {
|
||||
@skiptbls = split (/\,/,$output2[0]);
|
||||
}
|
||||
|
||||
my @files = readdir(DIRPATH);
|
||||
foreach my $table (@files)
|
||||
{
|
||||
@@ -64,6 +71,17 @@ foreach my $table (@files)
|
||||
}
|
||||
next;
|
||||
}
|
||||
# skip and table in the site.skiptables attribute
|
||||
if (@skiptbls) {
|
||||
my ($tmptable,$suffix) = split(/\./,$table);
|
||||
chomp $tmptable;
|
||||
if (grep(/^$tmptable$/, @skiptbls)) {
|
||||
if ($::VERBOSEREST) {
|
||||
xCAT::MsgUtils->message("I", "Skipping $tmptable\n");
|
||||
}
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
my $cmd = "tabrestore $tablename";
|
||||
my @errout = xCAT::Utils->runcmd($cmd, 0);
|
||||
|
Reference in New Issue
Block a user