Project

General

Profile

Revision c2496839

Added by Thomas McKay over 8 years ago

Checks /api/status for SAM (Headpin)

View differences:

lib/hammer_cli_csv/roles.rb
90 90
          filter_id = foreman_filter(name, line[RESOURCE], search)
91 91
          if !filter_id
92 92
            print " creating filter #{line[RESOURCE]}..." if option_verbose?
93
            @api.resource(:filters).call(:create, { 'filter' => {
94
                                           'role_id' => @existing_roles[name],
95
                                           'search' => search,
96
                                           'organization_ids' => organizations,
97
                                           'location_ids' => locations,
98
                                           'permission_ids' => permissions
99
                                         }})
93
            @api.resource(:filters)
94
              .call(:create, { 'filter' => {
95
                        'role_id' => @existing_roles[name],
96
                        'search' => search,
97
                        'unlimited' => search.empty?,
98
                        'organization_ids' => organizations,
99
                        'location_ids' => locations,
100
                        'permission_ids' => permissions
101
                      }})
100 102
          else
101 103
            print " updating filter #{line[RESOURCE]}..."
102
            @api.resource(:filters).call(:update, {
103
                                           'id' => filter_id,
104
                                           'search' => search,
105
                                           'organization_ids' => organizations,
106
                                           'location_ids' => locations,
107
                                           'permission_ids' => permissions
108
                                         })
104
            @api.resource(:filters)
105
              .call(:update, {
106
                      'id' => filter_id,
107
                      'search' => search,
108
                      'unlimited' => search.empty?,
109
                      'organization_ids' => organizations,
110
                      'location_ids' => locations,
111
                      'permission_ids' => permissions
112
                    })
109 113
          end
110 114

  
111 115
          puts 'done' if option_verbose?

Also available in: Unified diff