+ if ( sizeof($data['node']->pcu_ids) == 0)
+ {
+ $data['pcu_assigned'] = False;
+ $data['pcu_port'] = -1;
+ } else {
+ $data['pcu_assigned'] = True;
+ $api_pcus = $api->GetPCUs($data['node']->pcu_ids);
+ $pcu = $api_pcus[0];
+ # NOTE: find index of node id, then pull out that index of
+ $index = array_search($data['node_id'], $pcu['node_ids']);
+ $data['pcu_port'] = $pcu['ports'][$index];
+ }