Project

General

Profile

« Previous | Next » 

Revision c06f1783

Added by Thomas McKay almost 8 years ago

fixes #15743 - import and export of subscriptions one-per-line

View differences:

lib/hammer_cli_csv/architectures.rb
OPERATINGSYSTEMS = 'Operating Systems'
def export
CSV.open(option_file || '/dev/stdout', 'wb', {:force_quotes => true}) do |csv|
csv << [NAME, OPERATINGSYSTEMS]
@api.resource(:architectures).call(:index, {:per_page => 999999})['results'].each do |architecture|
architecture = @api.resource(:architectures).call(:show, {:id => architecture['id']})
name = architecture['name']
operatingsystems = export_column(architecture, 'operatingsystems', 'title')
csv << [name, operatingsystems]
end
def export(csv)
csv << [NAME, OPERATINGSYSTEMS]
@api.resource(:architectures).call(:index, {:per_page => 999999})['results'].each do |architecture|
architecture = @api.resource(:architectures).call(:show, {:id => architecture['id']})
name = architecture['name']
operatingsystems = export_column(architecture, 'operatingsystems', 'title')
csv << [name, operatingsystems]
end
end

Also available in: Unified diff