mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 03:12:30 +00:00 
			
		
		
		
	Work towards an xcoll workalike, also likely a xcsv workalike
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@15649 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		| @@ -101,8 +101,11 @@ Function Get-NodePower { | ||||
| 	$xcatrequest=@{'command'='rpower';'noderange'=$nodeRange;'args'=@('stat')} | ||||
| 	Send-xCATCommand($xcatrequest) | ||||
| } | ||||
| Function Merge-xCATData { | ||||
| Function Merge-xCATData { #xcoll attempt | ||||
| 	$groupeddata=$input|Group-Object -Property "node" | ||||
| 	foreach ($nodedata in $groupeddata) { | ||||
| 		 New-MergedxCATData $nodedata.Group | ||||
| 	} | ||||
| 	 | ||||
| } | ||||
| Function Set-NodePower { | ||||
| @@ -191,15 +194,19 @@ Function Send-xCATCommand { | ||||
|  | ||||
| Function New-MergedxCATData { #takes an arbitrary number of nodeData objects and spits out one | ||||
| 	Param( | ||||
| 		[parameter(ValueFromRemainingArguments=$true)] $nodeData | ||||
| 		$nodeData | ||||
| 	) | ||||
| 	$myprops = @{} | ||||
| 	$myprops.Data=@() | ||||
| 	$myprops.Node = $nodeData[0].Node | ||||
| 	$myobj = @{} | ||||
| 	$myobj.dataObjects=@() | ||||
| 	$myobj.NodeRange = $nodeData[0].Node | ||||
| 	foreach ($data in $nodeData) { | ||||
| 		$myprops.DataObjects += $data|select-object -ExcludeProperty Node * | ||||
| 		$rangedata = $data|select-object -ExcludeProperty Node * | ||||
| 		$rangedata.PSObject.TypeNames.RemoveAt(0) | ||||
| 		$myobj.dataObjects = $myobj.dataObjects  + $rangedata | ||||
| 	} | ||||
| 	write-host $myprops | ||||
| 	$newobj = New-Object -TypeName PSObject -Prop $myobj | ||||
| 	$newobj.PSObject.TypeNames.Insert(0,'xCATNodeRangeData') | ||||
| 	return $newobj | ||||
| } | ||||
| Function New-xCATDataFromXmlElement { | ||||
| 	Param( | ||||
|   | ||||
		Reference in New Issue
	
	Block a user