Project

General

Profile

Revision 8c7ba4af

Added by Thomas McKay about 8 years ago

updates to csv

fixed lifecycle-env

ship it

View differences:

lib/hammer_cli_csv/hosts.rb
84 84
          if !@existing.include? name
85 85
            print "Creating host '#{name}'..." if option_verbose?
86 86
            @api.resource(:hosts).call(:create, {
87
                               'host' => {
88 87
                                 'name' => name,
89 88
                                 'root_pass' => 'changeme',
90 89
                                 'mac' => namify(line[MACADDRESS], number),
......
94 93
                                 'architecture_id' => foreman_architecture(:name => line[ARCHITECTURE]),
95 94
                                 'domain_id' => foreman_domain(:name => line[DOMAIN]),
96 95
                                 'ptable_id' => foreman_partitiontable(:name => line[PARTITIONTABLE])
97
                               }
98 96
                             })
99 97
          else
100 98
            print "Updating host '#{name}'..." if option_verbose?
101 99
            @api.resource(:hosts).call(:update, {
102 100
                                 'id' => @existing[name],
103
                                 'host' => {
104 101
                                   'name' => name,
105 102
                                   'mac' => namify(line[MACADDRESS], number),
106 103
                                   'organization_id' => foreman_organization(:name => line[ORGANIZATION]),
......
109 106
                                   'architecture_id' => foreman_architecture(:name => line[ARCHITECTURE]),
110 107
                                   'domain_id' => foreman_domain(:name => line[DOMAIN]),
111 108
                                   'ptable_id' => foreman_partitiontable(:name => line[PARTITIONTABLE])
112
                                 }
113 109
                               })
114 110
          end
115 111
          print "done\n" if option_verbose?

Also available in: Unified diff