Project

General

Profile

Bug #23421

can't attach custom subscriptions to an activation key

Added by Evgeni Golov about 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Urgent
Assignee:
Category:
-
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

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'


Related issues

Related to Katello - Refactor #23424: add tests for adding subscriptions to an activation keyNew

Associated revisions

Revision 128de120 (diff)
Added by Evgeni Golov about 3 years ago

Fixes #23421 - use Subscription.cp_id instead of product_id

Katello::Subscription.product_id was renamed to cp_id in
2d170866abd0ebae1cb530f14e0fb5ace772f3dc

Use the new name when attaching custom subs to an activation key.

History

#1 Updated by The Foreman Bot about 3 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/7339 added

#2 Updated by Evgeni Golov about 3 years ago

  • Legacy Backlogs Release (now unused) set to 338

#3 Updated by Evgeni Golov about 3 years ago

  • Related to Refactor #23424: add tests for adding subscriptions to an activation key added

#4 Updated by Evgeni Golov about 3 years ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF