Work towards an xcoll workalike, also likely a xcsv workalike

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@15548 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2013-03-17 05:12:06 +00:00
parent 95c6a3d93d
commit ef8f762590

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(