mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 03:12:30 +00:00 
			
		
		
		
	Changed table name from capacity to hwinv.
This commit is contained in:
		| @@ -1503,10 +1503,10 @@ mic => { | ||||
|         disable => "Do not use.  tabprune will not work if set to yes or 1", | ||||
|     }, | ||||
| }, | ||||
| capacity => { | ||||
| hwinv => { | ||||
|     cols => [qw(node cputype cpucount memory disksize comments disable)], | ||||
|     keys => [qw(node)], | ||||
|     table_desc => 'The basic node capacity.', | ||||
|     table_desc => 'The hareware inventory for the node.', | ||||
|     descriptions => { | ||||
|         node => 'The node name or group name.', | ||||
|         cputype => 'The cpu model name for the node.', | ||||
| @@ -2505,23 +2505,23 @@ my @nodeattrs = ( | ||||
| 		access_tabentry => 'mic.node=attr:node', | ||||
| 	}, | ||||
| ##################### | ||||
| ##   capacity   table    # | ||||
| ##   hwinv   table    # | ||||
| ##################### | ||||
| 	{attr_name => 'cputype', | ||||
| 		tabentry => 'capacity.cputype', | ||||
| 		access_tabentry => 'capacity.node=attr:node', | ||||
| 		tabentry => 'hwinv.cputype', | ||||
| 		access_tabentry => 'hwinv.node=attr:node', | ||||
| 	}, | ||||
| 	{attr_name => 'cpucount', | ||||
| 		tabentry => 'capacity.cpucount', | ||||
| 		access_tabentry => 'capacity.node=attr:node', | ||||
| 		tabentry => 'hwinv.cpucount', | ||||
| 		access_tabentry => 'hwinv.node=attr:node', | ||||
| 	}, | ||||
| 	{attr_name => 'memory', | ||||
| 		tabentry => 'capacity.memory', | ||||
| 		access_tabentry => 'capacity.node=attr:node', | ||||
| 		tabentry => 'hwinv.memory', | ||||
| 		access_tabentry => 'hwinv.node=attr:node', | ||||
| 	}, | ||||
| 	{attr_name => 'disksize', | ||||
| 		tabentry => 'capacity.disksize', | ||||
| 		access_tabentry => 'capacity.node=attr:node', | ||||
| 		tabentry => 'hwinv.disksize', | ||||
| 		access_tabentry => 'hwinv.node=attr:node', | ||||
| 	}, | ||||
| 		 | ||||
|   );	# end of @nodeattrs that applies to both nodes and groups | ||||
|   | ||||
| @@ -154,10 +154,10 @@ sub process_request { | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     # save basic capacities in the capacity table | ||||
|     # save inventory info into the hwinv table | ||||
|     if (defined($request->{cpucount}) or defined($request->{cputype}) or defined($request->{memory}) or defined($request->{disksize})) { | ||||
| 	my $basicdata; | ||||
|         my $cap_tab = xCAT::Table->new("capacity",-create=>1); | ||||
|         my $hwinv_tab = xCAT::Table->new("hwinv",-create=>1); | ||||
|         if ($request->{memory}->[0]) { | ||||
| 	    $basicdata->{memory} = $request->{memory}->[0]; | ||||
|         } | ||||
| @@ -170,7 +170,7 @@ sub process_request { | ||||
|         if ($request->{cputype}->[0]) { | ||||
| 	    $basicdata->{cputype} = $request->{cputype}->[0]; | ||||
|         } | ||||
| 	$cap_tab->setNodeAttribs($node, $basicdata); | ||||
| 	$hwinv_tab->setNodeAttribs($node, $basicdata); | ||||
|     } | ||||
|  | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user