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:
jbjohnso 2013-03-25 13:57:47 +00:00
parent c1ee6f6383
commit e6cee5014a

View File

@ -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(