Project

General

Profile

Revision bfc065ce

Added by Thomas McKay over 8 years ago

roles-test - wip

roles-test - users now get roles, orgs, and locations

View differences:

.gitignore
20 20
pickle-email-*.html
21 21
.project
22 22
config/initializers/secret_token.rb
23
test/data/*.zip
24
test/config.yml
Gemfile
11 11

  
12 12
gem 'pry'
13 13
gem 'pry-debugger'
14

  
15
group :test do
16
  gem 'rake'
17
  gem 'thor'
18
  gem 'minitest', '4.7.4'
19
  gem 'minitest-spec-context'
20
  gem 'simplecov'
21
  gem 'mocha'
22
  gem 'ci_reporter'
23
end
Rakefile
4 4

  
5 5
Rake::TestTask.new do |t|
6 6
  t.libs << "lib"
7
  t.test_files = Dir.glob('test/**/*_test.rb')
7
  t.test_files = Dir['test/setup_test.rb'] + Dir.glob('test/**/*_test.rb')
8 8
  t.verbose = true
9 9
end
hammer-it
1 1
#!/bin/csh -f
2 2

  
3
# Replaced with: rake test TEST=test/setup_test.rb
4

  
3 5
bundle exec hammer -v csv:organizations      --csv-file test/data/organizations.csv
4 6
bundle exec hammer -v csv:users              --csv-file test/data/users.csv
5 7
bundle exec hammer -v csv:operatingsystems   --csv-file test/data/operatingsystems.csv
......
21 23
bundle exec hammer -v csv:systemgroups       --csv-file test/data/systemgroups.csv
22 24
bundle exec hammer -v csv:systems            --csv-file test/data/systems.csv
23 25
bundle exec hammer -v csv:activationkeys     --csv-file test/data/activationkeys.csv
26
bundle exec hammer -v csv:roles              --csv-file test/data/roles.csv
lib/hammer_cli_csv.rb
13 13
  require 'hammer_cli_csv/activation_keys'
14 14
  require 'hammer_cli_csv/architectures'
15 15
  require 'hammer_cli_csv/domains'
16
  require 'hammer_cli_csv/puppet_environments'
17 16
  require 'hammer_cli_csv/hosts'
17
  require 'hammer_cli_csv/locations'
18 18
  require 'hammer_cli_csv/operating_systems'
19 19
  require 'hammer_cli_csv/organizations'
20
  require 'hammer_cli_csv/permissions'
21 20
  require 'hammer_cli_csv/partition_tables'
21
  require 'hammer_cli_csv/permissions'
22
  require 'hammer_cli_csv/puppet_environments'
23
  require 'hammer_cli_csv/puppet_facts'
24
  require 'hammer_cli_csv/puppet_reports'
25
  require 'hammer_cli_csv/reports'
22 26
  require 'hammer_cli_csv/roles'
23 27
  require 'hammer_cli_csv/system_groups'
24 28
  require 'hammer_cli_csv/users'
25
  require 'hammer_cli_csv/puppet_facts'
26
  require 'hammer_cli_csv/puppet_reports'
27 29

  
28
  require 'hammer_cli_csv/lifecycle_environments'
30
  require 'hammer_cli_csv/activation_keys'
29 31
  require 'hammer_cli_csv/content_views'
32
  require 'hammer_cli_csv/lifecycle_environments'
33
  require 'hammer_cli_csv/products'
30 34
  require 'hammer_cli_csv/subscriptions'
31 35
  require 'hammer_cli_csv/systems'
32 36
  require 'hammer_cli_csv/system_groups'
33
  require 'hammer_cli_csv/products'
34
  require 'hammer_cli_csv/activation_keys'
35 37
end
lib/hammer_cli_csv/activation_keys.rb
100 100
        @existing[line[ORGANIZATION]] = {}
101 101
        @k_activationkey_api.index({
102 102
                                     'per_page' => 999999,
103
                                     'organization_id' => line[ORGANIZATION]
103
                                     'organization_id' => katello_organization(:name => line[ORGANIZATION])
104 104
                                   })[0]['results'].each do |activationkey|
105 105
          @existing[line[ORGANIZATION]][activationkey['name']] = activationkey['id'] if activationkey
106 106
        end
......
121 121
                                    })[0]
122 122
          @existing[line[ORGANIZATION]][activationkey['name']] = activationkey['id']
123 123
        else
124
          print "Updating activationkey '#{name}'..." if option_verbose?
124
          print "Updating activation key '#{name}'..." if option_verbose?
125 125
          activationkey = @k_activationkey_api.update({
126 126
                                        'id' => @existing[line[ORGANIZATION]][name],
127 127
                                        'name' => name,
lib/hammer_cli_csv/base.rb
82 82
      @f_permission_api ||= ForemanApi::Resources::Permission.new(@init_options)
83 83
      @f_partitiontable_api ||= ForemanApi::Resources::Ptable.new(@init_options)
84 84
      @f_puppetfacts_api ||= ForemanApi::Resources::FactValue.new(@init_options)
85
      @f_report_api ||= ForemanApi::Resources::Report.new(@init_options)
85 86
      @f_role_api ||= ForemanApi::Resources::Role.new(@init_options)
86 87
      @f_user_api ||= ForemanApi::Resources::User.new(@init_options)
87 88

  
......
89 90
      HammerCLI::EX_OK
90 91
    end
91 92

  
92
    def get_lines(filename)
93
      file = File.open(filename ,'r')
94
      contents = file.readlines
95
      file.close
96
      contents
97
    end
98

  
99 93
    def namify(name_format, number=0)
100 94
      if name_format.index('%')
101 95
        name = name_format % number
......
144 138
        return nil if options[:name].nil? || options[:name].empty?
145 139
        options[:id] = @organizations[options[:name]]
146 140
        if !options[:id]
147
          organization = @f_organization_api.index({'search' => "name=\"#{options[:name]}\""})[0]['results']
141
          organization = @f_organization_api.index({'search' => "title=\"#{options[:name]}\""})[0]['results']
148 142
          raise RuntimeError, "Organization '#{options[:name]}' not found" if !organization || organization.empty?
149 143
          options[:id] = organization[0]['id']
150 144
          @organizations[options[:name]] = options[:id]
......
165 159
      result
166 160
    end
167 161

  
162
    def katello_organization(options={})
163
      @organizations ||= {}
164

  
165
      if options[:name]
166
        return nil if options[:name].nil? || options[:name].empty?
167
        options[:id] = @organizations[options[:name]]
168
        if !options[:id]
169
          organization = @k_organization_api.index({'search' => "title=\"#{options[:name]}\""})[0]['results']
170
          raise RuntimeError, "Organization '#{options[:name]}' not found" if !organization || organization.empty?
171
          options[:id] = organization[0]['label']
172
          @organizations[options[:name]] = options[:id]
173
        end
174
        result = options[:id]
175
      else
176
        return nil if options[:id].nil?
177
        options[:name] = @organizations.key(options[:id])
178
        if !options[:name]
179
          organization = @k_organization_api.show({'id' => options[:id]})[0]
180
          raise "Organization 'id=#{options[:id]}' not found" if !organization || organization.empty?
181
          options[:name] = organization['name']
182
          @organizations[options[:name]] = options[:id]
183
        end
184
        result = options[:name]
185
      end
186

  
187
      result
188
    end
189

  
168 190
    def foreman_location(options={})
169 191
      @locations ||= {}
170 192

  
......
193 215
      result
194 216
    end
195 217

  
218
    def foreman_role(options={})
219
      @roles ||= {}
220

  
221
      if options[:name]
222
        return nil if options[:name].nil? || options[:name].empty?
223
        options[:id] = @roles[options[:name]]
224
        if !options[:id]
225
          role = @f_role_api.index({'search' => "name=\"#{options[:name]}\""})[0]['results']
226
          raise RuntimeError, "Role '#{options[:name]}' not found" if !role || role.empty?
227
          options[:id] = role[0]['id']
228
          @roles[options[:name]] = options[:id]
229
        end
230
        result = options[:id]
231
      else
232
        return nil if options[:id].nil?
233
        options[:name] = @roles.key(options[:id])
234
        if !options[:name]
235
          role = @f_role_api.show({'id' => options[:id]})[0]
236
          raise "Role 'id=#{options[:id]}' not found" if !role || role.empty?
237
          options[:name] = role['name']
238
          @roles[options[:name]] = options[:id]
239
        end
240
        result = options[:name]
241
      end
242

  
243
      result
244
    end
245

  
196 246
    def foreman_permission(options={})
197 247
      @permissions ||= {}
198 248

  
......
406 456
        return nil if options[:name].nil? || options[:name].empty?
407 457
        options[:id] = @environments[organization][options[:name]]
408 458
        if !options[:id]
409
          @k_environment_api.index({'organization_id' => organization})[0]['results'].each do |environment|
459
          @k_environment_api.index({'organization_id' => katello_organization(:name => organization)})[0]['results'].each do |environment|
410 460
            @environments[organization][environment['name']] = environment['id']
411 461
          end
412 462
          options[:id] = @environments[organization][options[:name]]
......
436 486
        return nil if options[:name].nil? || options[:name].empty?
437 487
        options[:id] = @contentviews[organization][options[:name]]
438 488
        if !options[:id]
439
          @k_contentview_api.index({'organization_id' => organization})[0]['results'].each do |contentview|
489
          @k_contentview_api.index({'organization_id' => katello_organization(:name => organization)})[0]['results'].each do |contentview|
440 490
            @contentviews[organization][contentview['name']] = contentview['id']
441 491
          end
442 492
          options[:id] = @contentviews[organization][options[:name]]
......
467 517
        options[:id] = @subscriptions[organization][options[:name]]
468 518
        if !options[:id]
469 519
          results = @k_subscription_api.index({
470
                                                'organization_id' => organization,
520
                                                'organization_id' => katello_organization(:name => organization),
471 521
                                                'search' => "name:\"#{options[:name]}\""
472 522
                                              })[0]
473 523
          raise "No subscriptions match '#{options[:name]}'" if results['subtotal'] == 0
......
502 552
        options[:id] = @systemgroups[organization][options[:name]]
503 553
        if !options[:id]
504 554
          @k_systemgroup_api.index({
505
                                     'organization_id' => organization,
555
                                     'organization_id' => katello_organization(:name => organization),
506 556
                                     'search' => "name:\"#{options[:name]}\""
507 557
                                   })[0]['results'].each do |systemgroup|
508 558
            @systemgroups[organization][systemgroup['name']] = systemgroup['id'] if systemgroup
......
532 582
      name
533 583
    end
534 584

  
585
    # "Red Hat 6.4" => "Red Hat", "6", "4"
586
    # "Red Hat 6"   => "Red Hat", "6", ""
535 587
    def split_os_name(name)
536
      (name, major, minor) = name.split(' ').collect {|s| s.split('.')}.flatten
588
      tokens = name.split(' ')
589
      is_number = Float(tokens[-1]) rescue false
590
      if is_number
591
        (major, minor) = tokens[-1].split('.').flatten
592
        name = tokens[0...-1].join(' ')
593
      else
594
        name = tokens.join(' ')
595
      end
537 596
      [name, major || "", minor || ""]
538 597
    end
539 598
  end
lib/hammer_cli_csv/domains.rb
87 87
                                           })[0]['domain']['id']
88 88
        end
89 89

  
90
        CSV.parse_line(line[ORGANIZATIONS]).each do |organization_label|
90
        CSV.parse_line(line[ORGANIZATIONS]).each do |organization|
91 91
          @k_organization_api.update({
92
                                       'id' => organization_label,
92
                                       'id' => foreman_organization(:name => organization),
93 93
                                       'domain_ids' => [domain_id]
94 94
                                     })
95 95
        end
lib/hammer_cli_csv/hosts.rb
97 97
          @f_host_api.create({
98 98
                             'host' => {
99 99
                               'name' => name,
100
                               'root_pass' => 'changeme',
100 101
                               'mac' => namify(line[MACADDRESS], number),
101 102
                               'organization_id' => foreman_organization(:name => line[ORGANIZATION]),
102 103
                               'environment_id' => foreman_environment(:name => line[ENVIRONMENT]),
lib/hammer_cli_csv/lifecycle_environments.rb
59 59
              label = environment['label']
60 60
              prior = environment['prior']
61 61
              description = environment['description']
62
              csv << [name, count, label, organization['label'], prior, description]
62
              csv << [name, count, label, organization['name'], prior, description]
63 63
            end
64 64
          end
65 65
        end
......
71 71
      @k_organization_api.index({'per_page' => 999999})[0]['results'].each do |organization|
72 72
        @k_environment_api.index({
73 73
                                   'per_page' => 999999,
74
                                   'organization_id' => organization['label']
74
                                   'organization_id' => katello_organization(:name => organization['name'])
75 75
                                 })[0]['results'].each do |environment|
76
          @existing[organization['label']] ||= {}
77
          @existing[organization['label']][environment['name']] = environment['id'] if environment
76
          @existing[organization['name']] ||= {}
77
          @existing[organization['name']][environment['name']] = environment['id'] if environment
78 78
        end
79 79
      end
80 80

  
......
92 92
        if !@existing[line[ORGANIZATION]].include? name
93 93
          print "Creating environment '#{name}'..." if option_verbose?
94 94
          @k_environment_api.create({
95
                                      'organization_id' => line[ORGANIZATION],
95
                                      'organization_id' => katello_organization(:name => line[ORGANIZATION]),
96 96
                                      'name' => name,
97 97
                                      'label' => label,
98
                                      'prior' => prior,
98
                                      'prior' => katello_environment(line[ORGANIZATION], :name => prior),
99 99
                                      'description' => line[DESCRIPTION]
100 100
                                    })
101 101
        else
102 102
          print "Updating environment '#{name}'..." if option_verbose?
103 103
          @k_environment_api.update({
104
                                      'id' => label,
104
                                      'id' => katello_environment(line[ORGANIZATION], :name => label),
105 105
                                      'name' => name,
106 106
                                      'new_name' => name,
107
                                      'organization_id' => line[ORGANIZATION],
107
                                      'organization_id' => katello_organization(:name => line[ORGANIZATION]),
108 108
                                      'prior' => prior,
109 109
                                      'description' => line[DESCRIPTION]
110 110
                                    })
lib/hammer_cli_csv/locations.rb
1
# Copyright (c) 2013-2014 Red Hat
2
#
3
# MIT License
4
#
5
# Permission is hereby granted, free of charge, to any person obtaining
6
# a copy of this software and associated documentation files (the
7
# "Software"), to deal in the Software without restriction, including
8
# without limitation the rights to use, copy, modify, merge, publish,
9
# distribute, sublicense, and/or sell copies of the Software, and to
10
# permit persons to whom the Software is furnished to do so, subject to
11
# the following conditions:
12
#
13
# The above copyright notice and this permission notice shall be
14
# included in all copies or substantial portions of the Software.
15
#
16
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
#
24
#
25
# -= Locations CSV =-
26
#
27
# Columns
28
#   Name
29
#     - Name of the location.
30
#     - May contain '%d' which will be replaced with current iteration number of Count
31
#     - eg. "location%d" -> "location1"
32
#   Count
33
#     - Number of times to iterate on this line of the CSV file
34
#
35

  
36
require 'hammer_cli'
37
require 'katello_api'
38
require 'json'
39
require 'csv'
40

  
41
module HammerCLICsv
42
  class LocationsCommand < BaseCommand
43

  
44
    def export
45
      CSV.open(option_csv_file || '/dev/stdout', 'wb', {:force_quotes => true}) do |csv|
46
        csv << [NAME, COUNT]
47
        @f_location_api.index({:per_page => 999999})[0]['results'].each do |location|
48
          csv << [location['name'], 1]
49
        end
50
      end
51
    end
52

  
53
    def import
54
      @existing = {}
55
      @f_location_api.index({:per_page => 999999})[0]['results'].each do |location|
56
        @existing[location['name']] = location['id'] if location
57
      end
58

  
59
      thread_import do |line|
60
        create_locations_from_csv(line)
61
      end
62
    end
63

  
64
    def create_locations_from_csv(line)
65
      line[COUNT].to_i.times do |number|
66
        name = namify(line[NAME], number)
67
        if !@existing.include? name
68
          print "Creating location '#{name}'... " if option_verbose?
69
          @f_location_api.create({
70
                                       'name' => name
71
                                     })
72
        else
73
          print "Updating location '#{name}'... " if option_verbose?
74
          #@f_location_api.update({
75
          #                             'id' => label
76
          #                           })
77
        end
78
        print "done\n" if option_verbose?
79
      end
80
    end
81
  end
82

  
83
  HammerCLI::MainCommand.subcommand("csv:locations", "ping the katello server", HammerCLICsv::LocationsCommand)
84
end
lib/hammer_cli_csv/operating_systems.rb
83 83
                                          }
84 84
                                        })
85 85
        else
86
          print "Updating operatingsystem '#{name}'..." if option_verbose?
86
          print "Updating operating system '#{name}'..." if option_verbose?
87 87
          @f_operatingsystem_api.update({
88 88
                                          'id' => @existing[name],
89 89
                                          'operatingsystem' => {
lib/hammer_cli_csv/partition_tables.rb
41 41
  class PartitionTablesCommand < BaseCommand
42 42

  
43 43
    OSFAMILY = 'OS Family'
44
    OPERATINGSYSTEMS = 'Operating Systems'
44 45
    LAYOUT = 'Layout'
45 46

  
46 47
    def export
47 48
      CSV.open(option_csv_file || '/dev/stdout', 'wb', {:force_quotes => true}) do |csv|
48
        csv << [NAME, COUNT, OSFAMILY, LAYOUT]
49
        csv << [NAME, COUNT, OSFAMILY, OPERATINGSYSTEMS, LAYOUT]
49 50
        @f_partitiontable_api.index({:per_page => 999999})[0]['results'].each do |ptable|
50 51
          ptable = @f_partitiontable_api.show({'id' => ptable['id']})[0]
51 52
          name = ptable['name']
52 53
          count = 1
53 54
          osfamily = ptable['os_family']
54 55
          layout = ptable['layout']
56
          raise "TODO: operating systems"
55 57
          csv << [name, count, osfamily, layout]
56 58
        end
57 59
      end
......
71 73
    def create_ptables_from_csv(line)
72 74
      line[COUNT].to_i.times do |number|
73 75
        name = namify(line[NAME], number)
76
        operatingsystem_ids = CSV.parse_line(line[OPERATINGSYSTEMS]).collect do |operatingsystem_name|
77
          foreman_operatingsystem(:name => operatingsystem_name)
78
        end if line[OPERATINGSYSTEMS]
74 79
        if !@existing.include? name
75 80
          print "Creating ptable '#{name}'... " if option_verbose?
76 81
          @f_partitiontable_api.create({
77
                                 'ptable' => {
78
                                   'name' => name,
79
                                   'os_family' => line[OSFAMILY],
80
                                   'layout' => line[LAYOUT]
81
                             }
82
                           })
82
                                         'ptable' => {
83
                                           'name' => name,
84
                                           'os_family' => line[OSFAMILY],
85
                                           'operatingsystem_ids' => operatingsystem_ids,
86
                                           'layout' => line[LAYOUT]
87
                                         }
88
                                       })
83 89
        else
84 90
          print "Updating ptable '#{name}'..." if option_verbose?
85 91
          @f_partitiontable_api.update({
86
                                 'id' => @existing[name],
87
                                 'ptable' => {
88
                                   'name' => name,
89
                                   'os_family' => line[OSFAMILY],
90
                                   'layout' => line[LAYOUT]
92
                                         'id' => @existing[name],
93
                                         'ptable' => {
94
                                           'name' => name,
95
                                           'os_family' => line[OSFAMILY],
96
                                           'operatingsystem_ids' => operatingsystem_ids,
97
                                           'layout' => line[LAYOUT]
91 98
                                 }
92 99
                           })
93 100
        end
lib/hammer_cli_csv/products.rb
44 44
  class ProductsCommand < BaseCommand
45 45

  
46 46
    ORGANIZATION = 'Organization'
47
    PROVIDER = 'Provider'
48 47
    REPOSITORY = 'Repository'
49 48
    REPOSITORY_TYPE = 'Repository Type'
50 49
    REPOSITORY_URL = 'Repository Url'
......
55 54

  
56 55
    def import
57 56
      @existing_products = {}
58
      @existing_providers = {}
59 57
      @existing_repositories = {}
60 58

  
61 59
      thread_import do |line|
......
64 62
    end
65 63

  
66 64
    def create_products_from_csv(line)
67
      if !@existing_providers[line[ORGANIZATION]]
68
        # TODO: get the red hat provider explicitly and put into list since it's not returned by index
69
        @existing_providers[line[ORGANIZATION]] = {}
70
        @k_provider_api.index({'organization_id' => line[ORGANIZATION], 'page_size' => 999999, 'paged' => true})[0]['results'].each do |provider|
71
          @existing_providers[line[ORGANIZATION]][provider['name']] = provider['id'] if provider
72
        end
73

  
65
      if !@existing_products[line[ORGANIZATION]]
74 66
        @existing_products[line[ORGANIZATION]] = {}
75
        @k_product_api.index({'organization_id' => line[ORGANIZATION], 'page_size' => 999999, 'paged' => true})[0]['results'].each do |product|
67
        @k_product_api.index({
68
                               'organization_id' => katello_organization(:name => line[ORGANIZATION]),
69
                               'page_size' => 999999,
70
                               'paged' => true
71
                             })[0]['results'].each do |product|
76 72
          @existing_products[line[ORGANIZATION]][product['name']] = product['id'] if product
77 73

  
78 74
          if product
79 75
            @k_repository_api.index({
80
                                      'organization_id' => line[ORGANIZATION],
76
                                      'organization_id' => katello_organization(:name => line[ORGANIZATION]),
81 77
                                      'product_id' => product['id'],
82 78
                                      'enabled' => true,
83 79
                                      'library' => true,
......
90 86
        end
91 87
      end
92 88

  
93
      # Only creating providers, not updating
94
      if !@existing_providers[line[ORGANIZATION]][line[PROVIDER]]
95
        print "Creating provider '#{line[PROVIDER]}'..." if option_verbose?
96
        id = @k_provider_api.create({
97
                                      'name' => line[PROVIDER],
98
                                      'organization_id' => line[ORGANIZATION]
99
                                    })[0]['id']
100
        @existing_providers[line[ORGANIZATION]][line[PROVIDER]] = id
101
        print "done\n" if option_verbose?
102
      end
103
      provider_id = @existing_providers[line[ORGANIZATION]][line[PROVIDER]]
104

  
105 89
      # Only creating products, not updating
106 90
      line[COUNT].to_i.times do |number|
107 91
        name = namify(line[NAME], number)
......
109 93
        if !product_id
110 94
          print "Creating product '#{name}'..." if option_verbose?
111 95
          product_id = @k_product_api.create({
112
                                               'name' => name,
113
                                               'provider_id' => provider_id
96
                                               'organization_id' => katello_organization(:name => line[ORGANIZATION]),
97
                                               'name' => name
114 98
                                             })[0]['id']
115 99
          @existing_products[line[ORGANIZATION]][name] = product_id
116 100
          print "done\n" if option_verbose?
......
122 106
        if !@existing_repositories[line[ORGANIZATION] + name][labelize(repository_name)]
123 107
          print "Creating repository '#{repository_name}' in product '#{name}'..." if option_verbose?
124 108
          @k_repository_api.create({
109
                                     'organization_id' => katello_organization(:name => line[ORGANIZATION]),
125 110
                                     'name' => repository_name,
126 111
                                     'label' => labelize(repository_name),
127 112
                                     'product_id' => product_id,
......
137 122
    end
138 123
  end
139 124

  
140
  HammerCLI::MainCommand.subcommand("csv:products", "import/export products and repositories", HammerCLICsv::ProductsCommand)
125
  HammerCLI::MainCommand.subcommand("csv:products", "import/export products and repositories",
126
                                    HammerCLICsv::ProductsCommand)
141 127
end
lib/hammer_cli_csv/puppet_environments.rb
40 40
module HammerCLICsv
41 41
  class PuppetEnvironmentsCommand < BaseCommand
42 42

  
43
    ORGANIZATIONS = 'Organizations'
44

  
43 45
    def export
44 46
      CSV.open(option_csv_file || '/dev/stdout', 'wb', {:force_quotes => true}) do |csv|
45
        csv << [NAME, COUNT]
47
        csv << [NAME, COUNT, ORGANIZATIONS]
46 48
        @f_environment_api.index({:per_page => 999999})[0]['results'].each do |environment|
47 49
          name = environment['name']
48 50
          count = 1
51
          raise "TODO: organizations"
49 52
          csv << [name, count]
50 53
        end
51 54
      end
......
67 70
        name = namify(line[NAME], number)
68 71
        if !@existing.include? name
69 72
          print "Creating environment '#{name}'..." if option_verbose?
70
          @f_environment_api.create({
71
                                      'environment' => {
72
                                        'name' => name
73
                                      }
74
                                    })
73
          id = @f_environment_api.create({
74
                                           'environment' => {
75
                                             'name' => name
76
                                           }
77
                                         })[0]['environment']['id']
75 78
        else
76 79
          print "Updating environment '#{name}'..." if option_verbose?
77
          @f_environment_api.update({
78
                                      'id' => @existing[name],
79
                                      'environment' => {
80
                                        'name' => name
81
                                      }
82
                                    })
80
          id = @f_environment_api.update({
81
                                           'id' => @existing[name],
82
                                           'environment' => {
83
                                             'name' => name
84
                                           }
85
                                         })[0]['environment']['id']
86
        end
87

  
88
        CSV.parse_line(line[ORGANIZATIONS]).each do |organization|
89
          @k_organization_api.update({
90
                                       'id' => foreman_organization(:name => organization),
91
                                       'environment_ids' => [id]
92
                                     })
83 93
        end
94

  
84 95
        print "done\n" if option_verbose?
85 96
      end
86 97
    rescue RuntimeError => e
lib/hammer_cli_csv/reports.rb
1
# Copyright (c) 2013-2014 Red Hat
2
#
3
# MIT License
4
#
5
# Permission is hereby granted, free of charge, to any person obtaining
6
# a copy of this software and associated documentation files (the
7
# "Software"), to deal in the Software without restriction, including
8
# without limitation the rights to use, copy, modify, merge, publish,
9
# distribute, sublicense, and/or sell copies of the Software, and to
10
# permit persons to whom the Software is furnished to do so, subject to
11
# the following conditions:
12
#
13
# The above copyright notice and this permission notice shall be
14
# included in all copies or substantial portions of the Software.
15
#
16
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
#
24

  
25
module HammerCLICsv
26
  class ReportsCommand < BaseCommand
27

  
28
    TIME = 'Time'
29
    APPLIED = 'Applied'
30
    RESTARTED = 'Restarted'
31
    FAILED = 'Failed'
32
    FAILED_RESTARTS = 'Failed Restarts'
33
    SKIPPED = 'Skipped'
34
    PENDING = 'Pending'
35
    METRICS = 'Metrics'
36

  
37
    def export
38
      CSV.open(option_csv_file || '/dev/stdout', 'wb', {:force_quotes => false}) do |csv|
39
        csv << [NAME, COUNT]
40
        @f_report_api.index({'per_page' => 999999})[0]['results'].each do |report|
41
          csv << [report['host_name'], 1, report['metrics'].to_json]
42
        end
43
      end
44

  
45
      HammerCLI::EX_OK
46
    end
47

  
48
    def import
49
      @existing_reports = {}
50
      @f_report_api.index({'per_page' => 999999})[0]['results'].each do |report|
51
        @existing_reports[report['name']] = report['id']
52
      end
53

  
54
      thread_import do |line|
55
        create_reports_from_csv(line)
56
      end
57
    end
58

  
59
    def create_reports_from_csv(line)
60
      line[COUNT].to_i.times do |number|
61
        name = namify(line[NAME], number)
62

  
63
        if !@existing_reports[name]
64
          print "Creating report '#{name}'..." if option_verbose?
65
          report = @f_report_api.create({
66
                                          'host' => name,
67
                                          'reported_at' => line[TIME],
68
                                          'status' => {
69
                                            'applied' => line[APPLIED],
70
                                            'restarted' => line[RESTARTED],
71
                                            'failed' => line[FAILED],
72
                                            'failed_restarts' => line[FAILED_RESTARTS],
73
                                            'skipped' => line[SKIPPED],
74
                                            'pending' => line[PENDING]
75
                                          },
76
                                          'metrics' => JSON.parse(line[METRICS]),
77
                                          'logs' => []
78
                                        })[0]
79
=begin
80
                                          'metrics' => {
81
                                            'time' => {
82
                                              'config_retrieval' => line[CONFIG_RETRIEVAL]
83
                                            },
84
                                            'resources' => {
85
                                              'applied' => 0,
86
                                              'failed' => 0,
87
                                              'failed_restarts' => 0,
88
                                              'out_of_sync' => 0,
89
                                              'restarted' => 0,
90
                                              'scheduled' => 1368,
91
                                              'skipped' => 1,
92
                                              'total' => 1450
93
                                            },
94
                                            'changes' => {
95
                                              'total' => 0
96
                                            }
97
                                          },
98
=end
99
          @existing_reports[name] = report['id']
100
        else
101
          print "Updating report '#{name}'..." if option_verbose?
102
          @f_report_api.update({
103
                                 'id' => @existing_reports[name]
104
                               })
105
        end
106

  
107
        puts "done" if option_verbose?
108
      end
109
    end
110
  end
111

  
112
  HammerCLI::MainCommand.subcommand("csv:reports", "import / export reports", HammerCLICsv::ReportsCommand)
113
end
lib/hammer_cli_csv/roles.rb
100 100
    def create_roles_from_csv(line)
101 101
      line[COUNT].to_i.times do |number|
102 102
        name = namify(line[NAME], number)
103
        filter = namify(line[FILTER], number)
103
        filter = namify(line[FILTER], number) if line[FILTER]
104 104

  
105 105
        if !@existing_roles[name]
106 106
          print "Creating role '#{name}'..." if option_verbose?
107
          role = @f_role_api.create({
108
                                      'name' => name
109
                                    })[0]
110
          @existing_roles[name] = role['id']
107 111
        else
108 112
          print "Updating role '#{name}'..." if option_verbose?
109 113
          @f_role_api.update({
......
113 117

  
114 118
        permissions = CSV.parse_line(line[PERMISSIONS], {:skip_blanks => true}).collect do |permission|
115 119
          foreman_permission(:name => permission)
116
        end
117
        puts permissions
120
        end if line[PERMISSIONS]
118 121
        organizations = CSV.parse_line(line[ORGANIZATIONS], {:skip_blanks => true}).collect do |organization|
119 122
          foreman_organization(:name => organization)
120
        end
123
        end if line[ORGANIZATIONS]
121 124
        locations = CSV.parse_line(line[LOCATIONS], {:skip_blanks => true}).collect do |location|
122 125
          foreman_location(:name => location)
123
        end
126
        end if line[LOCATIONS]
124 127

  
125
        filter_id = foreman_filter(name, :name => filter)
126
        if !filter_id
127
          @f_filter_api.create({
128
                                 'role_id' => @existing_roles[name],
129
                                 'search' => filter,
130
                                 'organization_ids' => organizations,
131
                                 'location_ids' => locations
132
                               })
133
        else
134
          @f_filter_api.update({
135
                                 'id' => filter_id,
136
                                 'search' => filter,
137
                                 'organization_ids' => organizations,
138
                                 'location_ids' => locations,
139
                                 'permission_ids' => permissions
140
                               })
128
        if filter
129
          filter_id = foreman_filter(name, :name => filter)
130
          if !filter_id
131
            @f_filter_api.create({
132
                                   'role_id' => @existing_roles[name],
133
                                   'search' => filter,
134
                                   'organization_ids' => organizations || [],
135
                                   'location_ids' => locations || [],
136
                                   'permission_ids' => permissions || []
137
                                 })
138
          else
139
            @f_filter_api.update({
140
                                   'id' => filter_id,
141
                                   'search' => filter,
142
                                   'organization_ids' => organizations || [],
143
                                   'location_ids' => locations || [],
144
                                   'permission_ids' => permissions || []
145
                                 })
146
          end
141 147
        end
142 148

  
143 149
        puts "done" if option_verbose?
lib/hammer_cli_csv/system_groups.rb
89 89
                                    'description' => line[DESCRIPTION]
90 90
                                  })
91 91
        else
92
          print "Updating systemgroup '#{name}'..." if option_verbose?
92
          print "Updating system group '#{name}'..." if option_verbose?
93 93
          @k_systemgroup_api.update({
94 94
                                      'organization_id' => line[ORGANIZATION],
95 95
                                      'id' => @existing[line[ORGANIZATION]][name],
lib/hammer_cli_csv/users.rb
21 21
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 22
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 23
#
24
#
25
# -= Users CSV =-
26
#
27
# Columns
28
#   Login
29
#     - Login name of the user.
30
#     - May contain '%d' which will be replaced with current iteration number of Count
31
#     - eg. "user%d" -> "user1"
32
#   Count
33
#     - Number of times to iterate on this line of the CSV file
34
#   First Name
35
#   Last Name
36
#   Email
37
#
38 24

  
39 25
require 'hammer_cli'
40 26
require 'katello_api'
......
47 33
    FIRSTNAME = 'First Name'
48 34
    LASTNAME = 'Last Name'
49 35
    EMAIL = 'Email'
36
    ORGANIZATIONS = 'Organizations'
37
    LOCATIONS = 'Locations'
38
    ROLES = 'Roles'
50 39

  
51 40
    def export
52 41
      CSV.open(option_csv_file || '/dev/stdout', 'wb', {:force_quotes => true}) do |csv|
53
        csv << [NAME, COUNT, FIRSTNAME, LASTNAME, EMAIL]
42
        csv << [NAME, COUNT, FIRSTNAME, LASTNAME, EMAIL, ORGANIZATIONS, LOCATIONS, ROLES]
54 43
        @f_user_api.index({:per_page => 999999})[0]['results'].each do |user|
55
          csv << [user['login'], 1, user['firstname'], user['lastname'], user['mail']]
44
          organizations = CSV.generate do |column|
45
            column << user['organizations'].collect do |organization|
46
              organization['name']
47
            end
48
          end.delete!("\n") if user['organizations']
49
          locations = CSV.generate do |column|
50
            column << user['locations'].collect do |location|
51
              location['name']
52
            end
53
          end.delete!("\n") if user['locations']
54
          roles = CSV.generate do |column|
55
            column << user['roles'].collect do |role|
56
              role['name']
57
            end
58
          end.delete!("\n") if user['roles']
59
          if user['login'] != 'admin' && !user['login'].start_with?('hidden-')
60
            csv << [user['login'], 1, user['firstname'], user['lastname'], user['mail'], organizations, locations, roles]
61
          end
56 62
        end
57 63
      end
58 64
    end
......
71 77
    def create_users_from_csv(line)
72 78
      line[COUNT].to_i.times do |number|
73 79
        name = namify(line[NAME], number)
80

  
81
        roles = CSV.parse_line(line[ROLES], {:skip_blanks => true}).collect do |role|
82
          foreman_role(:name => namify(role, number))
83
        end if line[ROLES]
84
        organizations = CSV.parse_line(line[ORGANIZATIONS], {:skip_blanks => true}).collect do |organization|
85
          foreman_organization(:name => organization)
86
        end if line[ORGANIZATIONS]
87
        locations = CSV.parse_line(line[LOCATIONS], {:skip_blanks => true}).collect do |location|
88
          foreman_location(:name => location)
89
        end if line[LOCATIONS]
90

  
74 91
        if !@existing.include? name
75 92
          print "Creating user '#{name}'... " if option_verbose?
76 93
          @f_user_api.create({
......
79 96
                                 'firstname' => line[FIRSTNAME],
80 97
                                 'lastname' => line[LASTNAME],
81 98
                                 'mail' => line[EMAIL],
82
                                 'password' => 'admin',
99
                                 'password' => 'changeme',
83 100
                                 'auth_source_id' => 1,  # INTERNAL auth
101
                                 'organization_ids' => organizations,
102
                                 'location_ids' => locations,
103
                                 'role_ids' => roles
84 104
                               }
85 105
                             })
86 106
        else
......
92 112
                                 'firstname' => line[FIRSTNAME],
93 113
                                 'lastname' => line[LASTNAME],
94 114
                                 'mail' => line[EMAIL],
95
                                 'password' => 'admin'
115
                                 'password' => 'changeme',
116
                                 'organization_ids' => organizations,
117
                                 'location_ids' => locations,
118
                                 'role_ids' => roles
96 119
                               }
97 120
                             })
98 121
        end
test/activation_keys_test.rb
7 7
  extend CommandTestHelper
8 8

  
9 9
  before :each do
10
    @activationkey_api = ApipieResourceMock.new(KatelloApi::Resources::ActivationKey)
11
    @organization_api = ApipieResourceMock.new(KatelloApi::Resources::Organization)
12
    @environment_api = ApipieResourceMock.new(KatelloApi::Resources::Environment)
13
    @contentview_api = ApipieResourceMock.new(KatelloApi::Resources::ContentView)
14 10
  end
15 11

  
16 12
  context "ActivationKeysCommand" do
17 13

  
18 14
    let(:cmd) { HammerCLICsv::ActivationKeysCommand.new("", ctx) }
19 15

  
20
    context "parameters" do
21
      it "blah" do
22
        cmd.stubs(:get_lines).returns([
23
                                       "Name,Count,Org Label,Description,Limit,Environment,Content View,System Groups",
24
                                       "'akey',1,'org','some description','Unlimited','Library','Default_Content_view',"
25
                                      ])
26
        cmd.run(['--csv-file=some_file', '--threads=1']).must_equal HammerCLI::EX_OK
27
      end
28
    end
29 16
  end
30 17
end
test/csv_test_helper.rb
15 15
require "mocha/setup"
16 16

  
17 17
require 'hammer_cli_csv'
18
require 'hammer_cli_katello'
19
require 'hammer_cli_foreman'
18 20

  
19
def ctx 
20
  { :adapter => :silent }
21
def ctx
22
  {
23
    :adapter => :csv,
24
    :interactive => false
25
  }
26
end
27

  
28
def hammer
29
  HammerCLI::MainCommand.new("", ctx)
30
end
31

  
32
def capture
33
  old_stdout = $stdout
34
  old_stderr = $stderr
35
  $stdout = stdout = StringIO.new
36
  $stderr = stderr = StringIO.new
37
  yield
38
  [stdout.string, stderr.string]
39
ensure
40
  $stdout = old_stdout
41
  $stderr = old_stderr
42
end
43

  
44
def set_user(username, password='changeme')
45
  HammerCLI::Settings.load({
46
                             :_params => {
47
                               :username => username,
48
                               :password => password,
49
                               :interactive => false
50
                             }})
21 51
end
22 52

  
23 53

  
test/data/activationkeys.csv
1 1
Name,Count,Organization,Description,Limit,Environment,Content View,System Groups,Subscriptions
2
damon.dials@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee","""RH00004|Red Hat Enterprise Linux Server, Standard (Physical or Virtual Nodes)"""
3
# jenee.jahns@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
4
# gilbert.guerriero@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
5
# quiana.quesnel@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
6
# bernard.bigler@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
7
# marietta.menzel@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
8
# ruby.rieser@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
9
# leonor.limberg@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
10
# herminia.hochmuth@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
11
# luana.larson@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
12
# gilda.gutirrez@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
13
# karlene.kirch@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
14
# chelsea.calaway@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
15
# tajuana.thies@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
16
# dominica.dubberly@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
17
# gregg.gault@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
18
# boyd.buckle@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
19
# georgeanna.griffiths@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
20
# julio.jerabek@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
21
# chaya.cordova@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
22
# reinaldo.reardon@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
23
# nancie.nassar@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
24
# ayako.alday@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
25
# skye.strobl@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
26
# merle.miceli@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
27
# sung.skipper@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
28
# danilo.dilbeck@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
29
# marylee.millsap@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
30
# rolf.rueb@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
31
# miriam.messenger@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
32
# danae.drayer@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
33
# stan.stokely@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
34
# martin.magallon@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
35
# orville.oneill@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
36
# kourtney.kyle@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
37
# tessa.treiber@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
38
# kamilah.kurland@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
39
# zelma.zemke@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
40
# jefferson.jock@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
41
# shirely.stowe@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
42
# niesha.nold@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
43
# bruce.butterworth@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
44
# denna.debartolo@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
45
# janay.johnson@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
46
# kristen.kellems@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
47
# tiny.tacy@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
48
# dolores.delay@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
49
# shira.sitzes@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
50
# aron.askew@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
51
# nydia.neil@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
52
# theodore.talbert@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
53
# shani.spinks@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
54
# diedra.darrow@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
55
# judith.joachim@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
56
# melda.metheny@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
57
# nannie.nobles@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
58
# annamae.audie@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
59
# kalyn.kimzey@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
60
# hsiu.henningsen@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
61
# delcie.diez@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
62
# edris.ekhoff@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
63
# monique.maly@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
64
# robbi.rosendahl@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
65
# lakeesha.loiacono@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
66
# coralee.culbert@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
67
# danette.dewitt@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
68
# cinthia.cadieux@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
69
# myron.mclawhorn@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
70
# madeleine.magers@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
71
# evita.epting@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
72
# karrie.kindel@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
73
# moses.modisette@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
74
# winifred.wessels@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
75
# ashton.aumann@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
76
# guillermina.gloster@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
77
# jeremy.jong@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
78
# marilou.mcintosh@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
79
# rubin.ravenscroft@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
80
# peggie.phillips@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
81
# evelina.elders@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
82
# edda.elam@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
83
# fausto.fortino@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
84
# elena.eisert@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
85
# mariella.molock@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
86
# starla.scheiber@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
87
# parker.paetzold@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
88
# vallie.vizcaino@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
89
# renea.rubenstein@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
90
# lien.lipscomb@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
91
# debby.dupuy@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
92
# carolann.corbo@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
93
# lee.litchfield@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
94
# lashon.locker@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
95
# caroll.colquitt@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
96
# lillian.louviere@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
97
# rafaela.rasco@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
98
# mandie.mcquinn@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
99
# bambi.bivona@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
100
# jacques.joaquin@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
101
# wes.wallner@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
102
# retta.rosso@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
103
# melia.meche@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
104
# nga.nordquist@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
105
# georgine.grimmett@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
106
# elden.easley@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
107
# van.villanveva@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
108
# shemika.spikes@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
109
# bettina.budniewski@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
110
# yun.yarberry@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
111
# mac.malmberg@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
112
# rory.rollinson@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Employee"
113
# silva.sotelo@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Contractor"
114
# le.leggett@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Contractor"
115
# eartha.edie@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Contractor"
116
# tenisha.tinajero@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Contractor"
117
# hien.hamby@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Contractor"
118
# milford.mize@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Contractor"
119
# elnora.efaw@megacorp.org,1,megacorp,"Individual account",1,Library,Default Organization View,"Contractor"
2
damon.dials@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee","""RH00004|Red Hat Enterprise Linux Server, Standard (Physical or Virtual Nodes)"""
3
jenee.jahns@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
4
gilbert.guerriero@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
5
quiana.quesnel@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
6
bernard.bigler@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
7
marietta.menzel@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
8
ruby.rieser@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
9
leonor.limberg@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
10
herminia.hochmuth@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
11
luana.larson@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
12
gilda.gutirrez@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
13
karlene.kirch@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
14
chelsea.calaway@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
15
tajuana.thies@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
16
dominica.dubberly@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
17
gregg.gault@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
18
boyd.buckle@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
19
georgeanna.griffiths@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
20
julio.jerabek@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
21
chaya.cordova@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
22
reinaldo.reardon@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
23
nancie.nassar@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
24
ayako.alday@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
25
skye.strobl@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
26
merle.miceli@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
27
sung.skipper@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
28
danilo.dilbeck@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
29
marylee.millsap@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
30
rolf.rueb@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
31
miriam.messenger@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
32
danae.drayer@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
33
stan.stokely@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
34
martin.magallon@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
35
orville.oneill@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
36
kourtney.kyle@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
37
tessa.treiber@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
38
kamilah.kurland@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
39
zelma.zemke@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
40
jefferson.jock@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
41
shirely.stowe@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
42
niesha.nold@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
43
bruce.butterworth@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
44
denna.debartolo@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
45
janay.johnson@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
46
kristen.kellems@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
47
tiny.tacy@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
48
dolores.delay@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
49
shira.sitzes@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
50
aron.askew@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
51
nydia.neil@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
52
theodore.talbert@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
53
shani.spinks@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
54
diedra.darrow@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
55
judith.joachim@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
56
melda.metheny@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
57
nannie.nobles@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
58
annamae.audie@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
59
kalyn.kimzey@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
60
hsiu.henningsen@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
61
delcie.diez@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
62
edris.ekhoff@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
63
monique.maly@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
64
robbi.rosendahl@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
65
lakeesha.loiacono@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
66
coralee.culbert@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
67
danette.dewitt@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
68
cinthia.cadieux@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
69
myron.mclawhorn@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
70
madeleine.magers@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
71
evita.epting@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
72
karrie.kindel@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
73
moses.modisette@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
74
winifred.wessels@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
75
ashton.aumann@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
76
guillermina.gloster@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
77
jeremy.jong@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
78
marilou.mcintosh@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
79
rubin.ravenscroft@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
80
peggie.phillips@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
81
evelina.elders@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
82
edda.elam@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
83
fausto.fortino@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
84
elena.eisert@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
85
mariella.molock@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
86
starla.scheiber@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
87
parker.paetzold@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
88
vallie.vizcaino@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
89
renea.rubenstein@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
90
lien.lipscomb@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
91
debby.dupuy@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
92
carolann.corbo@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
93
lee.litchfield@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
94
lashon.locker@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
95
caroll.colquitt@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
96
lillian.louviere@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
97
rafaela.rasco@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
98
mandie.mcquinn@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
99
bambi.bivona@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
100
jacques.joaquin@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
101
wes.wallner@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
102
retta.rosso@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
103
melia.meche@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
104
nga.nordquist@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
105
georgine.grimmett@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
106
elden.easley@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
107
van.villanveva@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
108
shemika.spikes@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
109
bettina.budniewski@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
110
yun.yarberry@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
111
mac.malmberg@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
112
rory.rollinson@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Employee"
113
silva.sotelo@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Contractor"
114
le.leggett@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Contractor"
115
eartha.edie@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Contractor"
116
tenisha.tinajero@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Contractor"
117
hien.hamby@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Contractor"
118
milford.mize@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Contractor"
119
elnora.efaw@megacorp.com,1,Mega Corporation,"Individual account",1,Library,Default Organization View,"Contractor"
test/data/domains.csv
1 1
"Name","Count","Full Name","Organizations"
2
"megacorp.com","1","","megacorp"
3
"demo.megacorp.com","1","","megacorp"
4
"qa.lab.tlv.megacorp.com","1","QA","megacorp"
5
"sat.lab.tlv.megacorp.com","1","SATLAB","megacorp"
6
"test.megacorp.com","1","","megacorp"
7
"tlv.megacorp.com","1","","megacorp"
8
"virt.bos.megacorp.com","1","","megacorp"
2
"megacorp.com","1","","Mega Corporation"
3
"demo.megacorp.com","1","","Mega Corporation"
4
"qa.lab.tlv.megacorp.com","1","QA","Mega Corporation"
5
"sat.lab.tlv.megacorp.com","1","SATLAB","Mega Corporation"
6
"test.megacorp.com","1","","Mega Corporation"
7
"tlv.megacorp.com","1","","Mega Corporation"
8
"virt.bos.megacorp.com","1","","Mega Corporation"
test/data/hosts.csv
1 1
Name,Count,Organization,Environment,Operating System,Architecture,MAC Address,Domain,Partition Table
2
dhcp129-0%02d.megacorp.com,255,Mega Corporation,Development,RHEL 6.4,x86_64,"01:FE:B5:E0:70:%02x",megacorp.com,RedHat default
2
dhcp129-%03d.megacorp.com,255,Mega Corporation,Development,RHEL 6.4,x86_64,"01:FE:B5:E0:70:%02x",megacorp.com,RedHat default
3 3
# dhcp129-1%02d.megacorp.com,255,Mega Corporation,Development,RHEL 6.4,x86_64,"01:FE:B5:E1:70:%02x",megacorp.com,RedHat default
4 4
# dhcp129-2%02d.megacorp.com,255,Mega Corporation,Development,RHEL 6.4,x86_64,"01:FE:B5:E2:70:%02x",megacorp.com,RedHat default
5 5
# dhcp129-3%02d.megacorp.com,255,Mega Corporation,Development,RHEL 6.4,x86_64,"01:FE:B5:E3:70:%02x",megacorp.com,RedHat default
test/data/lifecycleenvironments.csv
1 1
"Name","Count","Label","Organization","Prior Environment","Description"
2
"Development","1","Development","megacorp","Library",""
3
"Testing","1","Testing","megacorp","Development",""
4
"Stage","1","Stage","megacorp","Testing",""
5
"Production","1","Production","megacorp","Stage",""
6
"OpenStack","1","OpenStack","megacorp","Library",""
2
"Development","1","Development","Mega Corporation","Library",""
3
"Testing","1","Testing","Mega Corporation","Development",""
4
"Stage","1","Stage","Mega Corporation","Testing",""
5
"Production","1","Production","Mega Corporation","Stage",""
6
"OpenStack","1","OpenStack","Mega Corporation","Library",""
test/data/locations.csv
1
Name,Count
2
Asia Pacific (Tokyo) Region,1
3
Asia Pacific (Singapore) Region,1
4
Asia Pacific (Sydney) Region,1
5
EU (Ireland) Region,1
6
South America (Sao Paulo) Region,1
7
US East (Northern Virginia) Region,1
8
US West (Northern California) Region,1
9
US West (Oregon) Region,1
test/data/organizations.csv
1 1
"Name","Count","Org Label","Description"
2 2
"Mega Corporation","1","megacorp","The number one mega company in the world!"
3
"Mega Subsidiary","1","subcorp","The number one subsidiary of the number one mega company in the world!"
3 4

  
test/data/partitiontables.csv
1
"Name","Count","OS Family","Layout"
2
"ext4 default","1","Redhat","zerombr
1
"Name","Count","OS Family","Operating Systems","Layout"
2
"ext4 default","1","Redhat",,"zerombr
3 3
clearpart --all --initlabel
4 4
part /boot --fstype=ext4 --size=500
5 5
part / --fstype=ext4 --size=1024 --grow
6 6
part swap  --recommended"
7
"F16 / Grub2","1","Redhat","part biosboot --fstype=biosboot --size=1
7
"F16 / Grub2","1","Redhat",,"part biosboot --fstype=biosboot --size=1
8 8
zerombr
9 9
clearpart --all --initlabel
10 10
part /boot --fstype=ext4 --size=500
11 11
part / --fstype=ext4 --size=1024 --grow
12 12
part swap  --recommended"
13
"Katello Fedora Default","1","Redhat","zerombr
13
"Katello Fedora Default","1","Redhat",,"zerombr
14 14
clearpart --all --initlabel
15 15
part /boot --fstype ext3 --size=100 --asprimary
16 16
part /     --fstype ext3 --size=1024 --grow
17 17
part swap  --recommended"
18
"OpenStack Storage","1","Debian","d-i partman-auto/disk string /dev/vda
18
"OpenStack Storage","1","Debian",,"d-i partman-auto/disk string /dev/vda
19 19
d-i partman-auto/method string lvm
20 20

  
21 21
d-i partman-lvm/device_remove_lvm boolean true
......
72 72
d-i partman/confirm boolean true
73 73
d-i partman/confirm_nooverwrite boolean true
74 74
"
75
"RedHat default","1","Redhat","zerombr yes
75
"RedHat default","1","Redhat","RHEL 6.4,RHEL 6.3","zerombr yes
76 76
clearpart --all --initlabel
77 77
part /boot --fstype ext3 --size=100 --asprimary
78 78
part /     --fstype ext3 --size=1024 --grow
79 79
part swap  --recommended"
80
"Solaris medium disk mirrored","1","Solaris","filesys mirror:d10 c1t0d0s0 c1t1d0s0 16000 /
80
"Solaris medium disk mirrored","1","Solaris",,"filesys mirror:d10 c1t0d0s0 c1t1d0s0 16000 /
81 81
filesys mirror:d20 c1t0d0s1 c1t1d0s1 8000 swap
82 82
filesys mirror:d40 c1t0d0s4 c1t1d0s4 free /var/tmp
83 83
metadb c1t0d0s7 size 8192 count 3
84 84
metadb c1t1d0s7 size 8192 count 3
85 85
"
86
"Solaris small disk c1t0","1","Solaris","filesys c1t0d0s0 7000 /
86
"Solaris small disk c1t0","1","Solaris",,"filesys c1t0d0s0 7000 /
87 87
filesys c1t0d0s1 1000 swap
88 88
filesys c1t0d0s3 15 unnamed
89 89
filesys c1t0d0s7 free /tmp2
90 90
"
91
"Suse Entire SCSI Disk","1","Suse","  <partitioning  config:type=""list"">
91
"Suse Entire SCSI Disk","1","Suse",,"  <partitioning  config:type=""list"">
92 92
    <drive>
93 93
      <device>/dev/sda</device>       
94 94
      <use>all</use>
95 95
    </drive>
96 96
  </partitioning>"
97
"Suse Entire Virtual Disk","1","Suse","  <partitioning  config:type=""list"">
97
"Suse Entire Virtual Disk","1","Suse",,"  <partitioning  config:type=""list"">
98 98
    <drive>
99 99
      <device>/dev/vda</device>       
100 100
      <use>all</use>
101 101
    </drive>
102 102
  </partitioning>"
103
"Ubuntu custom LVM","1","Debian","d-i partman-auto/disk string /dev/vda
103
"Ubuntu custom LVM","1","Debian",,"d-i partman-auto/disk string /dev/vda
104 104
d-i partman-auto/method string lvm
105 105

  
106 106
d-i partman-lvm/device_remove_lvm boolean true
......
158 158
d-i partman/confirm boolean true
159 159
d-i partman/confirm_nooverwrite boolean true
160 160
"
161
"Ubuntu default","1","Debian","d-i partman-auto/disk string /dev/vda
161
"Ubuntu default","1","Debian",,"d-i partman-auto/disk string /dev/vda
162 162
d-i partman-auto/method string regular
163 163
d-i partman-auto/init_automatically_partition select Guided - use entire disk
164 164
d-i partman/confirm_write_new_label boolean true
......
166 166
Finish partitioning and write changes to disk
167 167
d-i partman/confirm boolean true
168 168
"
169
"vg-redhat","1","Redhat","zerombr yes
169
"vg-redhat","1","Redhat",,"zerombr yes
170 170
clearpart --all --initlabel
171 171
part /boot --fstype ext4 --size 200 --asprimary
172 172
part pv.01 --grow --size=1024
173 173
volgroup <%= shortname %> pv.01
174 174
logvol / --fstype=ext4 --name=root --vgname=<%= shortname %> --grow --size=1024
175 175
logvol swap --name=swap --vgname=<%= shortname %>  --recommended"
176
"Windows Entire SCSI Disk","1","Windows","  <partitioning  config:type=""list"">
176
"Windows Entire SCSI Disk","1","Windows",,"  <partitioning  config:type=""list"">
177 177
    <drive>
178 178
      <device>/stuff</device>       
179 179
      <use>all</use>
180 180
    </drive>
181 181
  </partitioning>"
182
"Windows Entire Virtual Disk","1","Windows","  <partitioning  config:type=""list"">
182
"Windows Entire Virtual Disk","1","Windows",,"  <partitioning  config:type=""list"">
183 183
    <drive>
184 184
      <device>/data</device>       
185 185
      <use>all</use>
test/data/products.csv
1
Name,Count,Organization,Provider,Repository,Repository Type,Repository Url
2
Point of Sale,1,megacorp,MegaCorp,katello-1.4-client,yum,http://fedorapeople.org/groups/katello/releases/yum/1.4-client/RHEL/6Server/x86_64/
3
katello-1.4,1,megacorp,MegaCorp,katello-1.4,yum,http://fedorapeople.org/groups/katello/releases/yum/1.4/RHEL/6Server/x86_64/
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff