Project

General

Profile

Revision d0d41780

Added by Thomas McKay about 8 years ago

fixing limit on activation key

View differences:

lib/hammer_cli_csv/activation_keys.rb
108 108
                                                                                :name => line[ENVIRONMENT]),
109 109
                                        'content_view_id' => katello_contentview(line[ORGANIZATION],
110 110
                                                                                 :name => line[CONTENTVIEW]),
111
                                        'description' => line[DESCRIPTION]
111
                                        'description' => line[DESCRIPTION],
112
                                        'usage_limit' => usage_limit(line[LIMIT])
112 113
                                      })
113 114
            @existing[line[ORGANIZATION]][activationkey['name']] = activationkey['id']
114 115
          else
......
120 121
                                                                                  :name => line[ENVIRONMENT]),
121 122
                                          'content_view_id' => katello_contentview(line[ORGANIZATION],
122 123
                                                                                   :name => line[CONTENTVIEW]),
123
                                          'description' => line[DESCRIPTION]
124
                                          'description' => line[DESCRIPTION],
125
                                          'usage_limit' => usage_limit(line[LIMIT])
124 126
                                        })
125 127
          end
126 128

  
......
151 153
            {
152 154
              :id => katello_subscription(line[ORGANIZATION], :name => name),
153 155
              :quantity => amount
154
             }
156
            }
155 157
          end
156 158

  
157 159
          # TODO: should there be a destroy_all similar to systems?
......
171 173
                                             })
172 174
        end
173 175
      end
174
    end
175 176

  
177
      def usage_limit(limit)
178
        Integer(limit) rescue -1
179
      end
180
    end
176 181
  end
177 182
end

Also available in: Unified diff