Actions
Bug #23421
closedcan't attach custom subscriptions to an activation key
Description
katello 3.7 (git):
[root@rhel7 ~]# hammer product create --name foobar --organization-id 1 Product created [root@rhel7 ~]# hammer subscription list --organization-id 1 ---|----------------------------------|--------|----------|----------|---------|---------|---------------------|-----------|--------- ID | UUID | NAME | TYPE | CONTRACT | ACCOUNT | SUPPORT | END DATE | QUANTITY | CONSUMED ---|----------------------------------|--------|----------|----------|---------|---------|---------------------|-----------|--------- 1 | ff8080816306b25d016306bd64940007 | foobar | Physical | | | | 2048/04/19 10:54:25 | Unlimited | 0 ---|----------------------------------|--------|----------|----------|---------|---------|---------------------|-----------|--------- [root@rhel7 ~]# hammer activation-key create --name foobar --organization-id 1 Activation key created [root@rhel7 ~]# hammer activation-key add-subscription --subscription-id ff8080816306b25d016306bd64940007 --name foobar --organization-id 1 Could not add subscription to activation key: undefined method `product_id' for #<Katello::Subscription:0x00007efc27eff9c8>
log:
2018-04-27T10:55:19 [E|app|400ad] NoMethodError: undefined method `product_id' for #<Katello::Subscription:0x00007efc27eff9c8> | /opt/theforeman/tfm-ror51/root/usr/share/gems/gems/activemodel-5.1.4/lib/active_model/attribute_methods.rb:432:in `method_missing' | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0/app/models/katello/glue/candlepin/activation_key.rb:52:in `subscribe' | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.7.0/app/controllers/katello/api/v2/activation_keys_controller.rb:185:in `add_subscriptions'
Actions