Project

General

Profile

Revision 502df2e4

Added by Thomas McKay about 6 years ago

repo enable for subscriptions that don't have release version

View differences:

lib/hammer_cli_csv/organizations.rb
41 41
          name = namify(line[NAME], number)
42 42
          return if option_organization && name != option_organization
43 43
          label = namify(line[LABEL], number)
44
          if !@existing.include? name
44
          organization_id = @existing[name]
45
          if organization_id.nil?
45 46
            print "Creating organization '#{name}'... " if option_verbose?
46 47
            @api.resource(:organizations).call(:create, {
47 48
                'name' => name,
......
53 54
            })
54 55
          else
55 56
            print "Updating organization '#{name}'... " if option_verbose?
57
            organization = @api.resource(:organizations).call(:show, {'id' => organization_id})
56 58
            @api.resource(:organizations).call(:update, {
57
                'id' => foreman_organization(:name => name),
59
                'id' => organization_id,
58 60
                'organization' => {
59
                    'id' => foreman_organization(:name => name),
61
                    'id' => organization_id,
60 62
                    'description' => line[DESCRIPTION]
61 63
                }
62 64
            })

Also available in: Unified diff