[% USE CSV -%]
[% CSV.dump([ 'Device' 'Access Point' 'Model' 'Radio' 'Node Count' ]) %]

[% FOREACH row IN results %]
  [% mylist = [] %]
  [% mylist.push(row.dns || row.name || row.ip) %]
  [% mylist.push(row.ports.port) %]
  [% mylist.push(row.model) %]
  [% mylist.push(row.ports.type) %]
  [% mylist.push(row.mac_count) %]
  [% CSV.dump(mylist) %]

[% END %]
