mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-04 05:12:30 +00:00 
			
		
		
		
	more on plugable DB schema.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2596 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		@@ -33,7 +33,11 @@ foreach (@extSchema) {
 | 
			
		||||
    if (${"xCAT_schema::" . "$modname" . "::"}{tabspec}) {
 | 
			
		||||
	my %tabspec=%{${"xCAT_schema::" . "$modname" . "::"}{tabspec}};
 | 
			
		||||
	foreach my $tabname (keys(%tabspec)) {
 | 
			
		||||
	    $ext_tabspec{$tabname}=$tabspec{$tabname};
 | 
			
		||||
            if (exists($ext_tabspec{$tabname})) {
 | 
			
		||||
		xCAT::MsgUtils->message('ES', "\n  Warning: File $file: the table name $tabname is used by other applications. Please rename the table.\n");
 | 
			
		||||
	    } else {
 | 
			
		||||
		$ext_tabspec{$tabname}=$tabspec{$tabname};
 | 
			
		||||
	    }
 | 
			
		||||
	}
 | 
			
		||||
    } else {
 | 
			
		||||
	xCAT::MsgUtils->message('ES', "\n  Warning: Cannot find \%tabspec variable in the user defined database table schema file $file\n");
 | 
			
		||||
@@ -105,6 +109,7 @@ foreach (@extSchema) {
 | 
			
		||||
sub updateTables
 | 
			
		||||
{
 | 
			
		||||
    #print "\nupdateTables\n";
 | 
			
		||||
    print "\n";
 | 
			
		||||
    foreach (keys %ext_tabspec) {
 | 
			
		||||
	my $table= xCAT::Table->new($_,-create=>1,-autocommit=>1);
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -589,7 +589,11 @@ performance => {
 | 
			
		||||
# adding user defined external tables
 | 
			
		||||
##################################################
 | 
			
		||||
foreach my $tabname (keys(%xCAT::ExtTab::ext_tabspec)) {
 | 
			
		||||
    $tabspec{$tabname}=$xCAT::ExtTab::ext_tabspec{$tabname};
 | 
			
		||||
    if (exists($tabspec{$tabname})) {
 | 
			
		||||
	xCAT::MsgUtils->message('ES', "\n  Warning: Conflict when adding user defined tablespec. Duplicate table name: $tabname. \n");
 | 
			
		||||
    } else {
 | 
			
		||||
      $tabspec{$tabname}=$xCAT::ExtTab::ext_tabspec{$tabname};
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user