-Revert expression modification to Table for now

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2151 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2008-09-12 13:47:09 +00:00
parent 201309330b
commit 09c9b1110f

View File

@ -1723,30 +1723,6 @@ sub getAttribs
{
unless ($data->{$attrib} =~ /^$/ || !defined($data->{$attrib}))
{ #To undef fields in rows that may still be returned
my $wrkstr = $data->{$attrib};
my $out;
while ($wrkstr =~ /(\{.*?\})/g) {
#-- this have to be thoroughly tested...
#-- special constructions in tables
#-- for example allows to have the same database for two xCAT master servers
#-- hence helping xCAT high availability
my $exp = $1;
my $expfound = 0;
$exp =~ /^{hostname}$/ && do { $out = qx/hostname/; chomp $out; $expfound = 1; };
$exp =~ /^{xcatmaster}$/ && do {
my $ostab = xCAT::Table->new('site');
$out = $ostab->getAttribs({key=>"master"},'value');
if ($out and $out->{value}) {
$out = $out->{'value'}; $expfound = 1;
}
};
$wrkstr =~ s/$exp/$out/ if $expfound;
}
$data->{$attrib} = $wrkstr;
$rethash{$attrib} = $data->{$attrib};
}
}