Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Created attachment 920042[details]
A screenshot of one of the relevant errors.
Description of problem:
Issuing an HTTP GET to various URLs reveals that the structure of the JSON results is inconsistent, and the data contained within those results is incomplete. In particular, some foreign key relationships are broken. See: http://pastebin.com/QDS001Ex
Version-Release number of selected component (if applicable):
* apr-util-ldap-1.3.9-3.el6_0.1.x86_64
* candlepin-0.9.21-1.el6.noarch
* candlepin-selinux-0.9.21-1.el6.noarch
* candlepin-tomcat6-0.9.21-1.el6.noarch
* elasticsearch-0.90.10-4.el6.noarch
* foreman-1.6.0-0.develop.201407211519git93f6f75.el6.noarch
* foreman-compute-1.6.0-0.develop.201407211519git93f6f75.el6.noarch
* foreman-gce-1.6.0-0.develop.201407211519git93f6f75.el6.noarch
* foreman-libvirt-1.6.0-0.develop.201407211519git93f6f75.el6.noarch
* foreman-ovirt-1.6.0-0.develop.201407211519git93f6f75.el6.noarch
* foreman-postgresql-1.6.0-0.develop.201407211519git93f6f75.el6.noarch
* foreman-proxy-1.6.0-0.develop.201407211449git2cba606.el6.noarch
* foreman-release-1.6.0-0.develop.201407211519git93f6f75.el6.noarch
* foreman-selinux-1.6.0-0.develop.201406261522git5532684.el6.noarch
* foreman-vmware-1.6.0-0.develop.201407211519git93f6f75.el6.noarch
* katello-1.5.0-14.201407211524gitddbde13.el6.noarch
* katello-ca-1.0-1.noarch
* katello-certs-tools-1.5.2-1.git.1.edab2c4.el6.noarch
* katello-installer-0.0.19-1.201407162131gitb142720.el6.noarch
* katello-repos-1.5.1-1.git.14.0868bd1.el6.noarch
* openldap-2.4.23-31.el6.x86_64
* pulp-katello-0.3-3.el6.noarch
* pulp-nodes-common-2.4.0-0.24.beta.el6.noarch
* pulp-nodes-parent-2.4.0-0.24.beta.el6.noarch
* pulp-puppet-plugins-2.4.0-0.24.beta.el6.noarch
* pulp-puppet-tools-2.4.0-0.24.beta.el6.noarch
* pulp-rpm-plugins-2.4.0-0.24.beta.el6.noarch
* pulp-selinux-2.4.0-0.24.beta.el6.noarch
* pulp-server-2.4.0-0.24.beta.el6.noarch
* python-ldap-2.3.10-1.el6.x86_64
* ruby193-rubygem-net-ldap-0.3.1-2.el6.noarch
* ruby193-rubygem-runcible-1.1.0-1.el6.noarch
How reproducible:
100%
Steps to Reproduce:
1. Issue an HTTP GET to `katello/api/v2/content_views/:id` or `katello/api/v2/repositories/:id`.
2. Examine the JSON payload returned. In particular, look at the foreign key relationships.
3. Discover that foreign keys are named inconsistently and have an inconsistent data format.
Actual results:
Foreign keys named "<entity_name>", associated with an incomplete set of JSON data about the linked-to entity.
Expected results:
Foreign keys named "<entity_name>_id", associated with the ID of the linked-to entity.
Additional info:
A full example can be found here: http://pastebin.com/QDS001Ex
Test code which produces this outcome can be found here: https://github.com/omaciel/robottelo/blob/master/tests/foreman/api/test_multiple_paths.py#L95-L128
Pull request #1068 will cause that test code to move. If #1068 is moved, you can find the test code here instead: https://github.com/omaciel/robottelo/blob/master/tests/foreman/api/test_multiple_paths.py#L231-L310
The really relevant lines of test code are as follows: (ignore the `path` var)
> self.assertIn(key, real_attrs.keys(), path)
> self.assertEqual(value, real_attrs[key], path)
I've attached a screenshot of one of the relevant errors.
Comment 1RHEL Program Management
2014-07-22 20:24:21 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.
This issue also applies to activation keys. If one issues an HTTP GET to api/v2/activation_keys/:id, the response contains the following pieces of information:
[
u'content_overrides',
u'content_view',
u'content_view_id',
u'created_at',
u'description',
u'environment',
u'environment_id',
u'host_collections',
u'id',
u'max_content_hosts',
u'name',
u'organization',
u'permissions',
u'pools',
u'products',
u'release_version',
u'service_level',
u'unlimited_content_hosts',
u'updated_at',
u'usage_count',
u'user_id',
]
Notice that most foreign keys add "_id" to the end of their names, such as "environment_id" and "user_id". However, there is no "organization_id" key, even though an activation key does have a foreign key relationship to an organization.
This issue is currently known to affect the following URLs:
* api/v2/activation_keys
* api/v2/content_views
* api/v2/gpg_keys
* api/v2/environments
* api/v2/repositories
Closing this bug because it is worded poorly. For a more concrete and actionable set of bug reports, see #1151220 and #1151240.
*** This bug has been marked as a duplicate of bug 1151240 ***