Bug #18707
closedHost associated subscription links are incorrect as well as the associated host in RH Subscriptions
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1425052
Description of problem:
Link to subscription listed in the Content host -> Subscriptions are pointing to an incorrect subscription or even to non-existing subscription. Also the page RH Subscriptions -> (Subscription) -> Associations -> Hosts does not show any associated host mainly for the VDC subscription.
How reproducible:
On system with multiple subscriptions, install new HyperVisor, attach VDC subscription with some other available subscriptions for sake of debug. You will be able to see wrong links in the content host detail page as well as no host associated for the VDC subscription on the RH Subscriptions page although there is clearly mentioned that the subscription is being consumed.
Actual results:
1) Links in Content Hosts -> Detail of the host -> Subscriptions to the subscription detail page are wrong.
2) Associated hosts list in RH Subscriptions -> Subscription detail -> Associations -> Hosts are not listed
Expected results:
1) Link will be corrected
2) Page will list all hosts to which was the subscription assigned
Additional info:
The reason for the 1) issue, probably even both issues is discrepancy between subscription_id and id in the API JSON response, where the subscription_id for the link is being used instead of id.
Example:
API Response snippet:
~~
quantity_consumed: 1,
id: 4,
cp_id: "8a8a8a84503ca5bc01503cf0bf8f01ef",
subscription_id: 2,
name: "Employee SKU",
start_date: "2013-04-24T04:00:00.000+0000",
end_date: "2022-01-01T04:59:59.000+0000",
available: 2,
quantity: 6,
consumed: 4,
account_number: 540155,
contract_number: 10169621,
support_level: "Self-Support",
product_id: "ES0113909",
sockets: 128,
cores: null,
ram: null,
instance_multiplier: 1,
stacking_id: null,
multi_entitlement: null,
type: "NORMAL",
product_name: "Employee SKU",
unmapped_guest: false,
virt_only: false
~~
Links in the WebUI generated based on the above response:
~~
https://katello.example.com/subscriptions/2/info
~~
The ID in the above link should be 4 in this case.