mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-11-04 05:12:30 +00:00 
			
		
		
		
	Add mkdef error msg
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1607 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		@@ -668,7 +668,30 @@ sub setobjdefs
 | 
			
		||||
 | 
			
		||||
                    # need to check the attrs we are setting for the object
 | 
			
		||||
                    #   as well as the attrs for this object that may be
 | 
			
		||||
                   #   already set in DB
 | 
			
		||||
                   	#   already set in DB
 | 
			
		||||
 | 
			
		||||
					if ( !($objhash{$objname}{$check_attr})  && !($DBattrvals{$objname}{$check_attr}) ) {
 | 
			
		||||
                        # if I didn't already check for this attr
 | 
			
		||||
                        # if ($::VERBOSE) {
 | 
			
		||||
                        my $rsp;
 | 
			
		||||
                        if (!grep(/^$attr_name$/, @checkedattrs)) {
 | 
			
		||||
                            push @{$rsp->{data}}, "Cannot set the \'$attr_name\' attribute unless a value is provided for \'$check_attr\'.\n";
 | 
			
		||||
 | 
			
		||||
                            foreach my $tmp_attr (@{$datatype->{'attrs'}}) {
 | 
			
		||||
                                my $attr = $tmp_attr->{attr_name};
 | 
			
		||||
                                if ($attr eq $check_attr) {
 | 
			
		||||
                                    my ($tab, $at) = split(/\./, $tmp_attr->{tabentry});
 | 
			
		||||
                                    my $schema = xCAT::Table->getTableSchema($tab);
 | 
			
		||||
                                    $desc = $schema->{descriptions}->{$at};
 | 
			
		||||
                                    push @{$rsp->{data}}, "$check_attr => $desc\n";
 | 
			
		||||
                                }
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
						xCAT::MsgUtils->message("I", $rsp, $::callback);
 | 
			
		||||
                       # }
 | 
			
		||||
						push(@checkedattrs, $attr_name);
 | 
			
		||||
                        next;
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
					if ( !($objhash{$objname}{$check_attr} =~ /\b$check_value\b/) && !($DBattrvals{$objname}{$check_attr}  =~ /\b$check_value\b/) )
 | 
			
		||||
                    {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user