Bug 798786 - JSON returns incorrect URLs from _attrs
JSON returns incorrect URLs from _attrs
Status: CLOSED ERRATA
Product: CloudForms Cloud Engine
Classification: Red Hat
Component: iwhd (Show other bugs)
1.0.0
Unspecified Unspecified
unspecified Severity high
: rc
: ---
Assigned To: Jim Meyering
Brad P. Crochet
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-29 15:53 EST by Brad P. Crochet
Modified: 2013-03-13 16:41 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-05-15 16:05:58 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Remove attr_ from JSON template (337 bytes, patch)
2012-02-29 16:51 EST, Brad P. Crochet
no flags Details | Diff

  None (edit)
Description Brad P. Crochet 2012-02-29 15:53:58 EST
Description of problem:
Asking for _attrs on an object returns the wrong URL. attr_ is prepended to the attr name. The XML correctly does not include attr_

Version-Release number of selected component (if applicable):
iwhd-1.2-3.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1. curl -H 'Accept: */json' http://localhost:9090/images/cdb4d9cb-f9f9-469c-b88c-649af9eaea8b/_attrs
2.
3.
  
Actual results:
{
	"object_body": "http://localhost:9090/images/cdb4d9cb-f9f9-469c-b88c-649af9eaea8b",
	"object_attr_list": "http://localhost:9090/images/cdb4d9cb-f9f9-469c-b88c-649af9eaea8b/_attrs",
	"attr_latest_build": "http://localhost:9090/images/cdb4d9cb-f9f9-469c-b88c-649af9eaea8b/attr_latest_build",
	"attr_latest_unpushed": "http://localhost:9090/images/cdb4d9cb-f9f9-469c-b88c-649af9eaea8b/attr_latest_unpushed",
	"attr_object_type": "http://localhost:9090/images/cdb4d9cb-f9f9-469c-b88c-649af9eaea8b/attr_object_type",
	"attr_template": "http://localhost:9090/images/cdb4d9cb-f9f9-469c-b88c-649af9eaea8b/attr_template",
	"attr_uuid": "http://localhost:9090/images/cdb4d9cb-f9f9-469c-b88c-649af9eaea8b/attr_uuid"
}


Expected results:
{
	"object_body": "http://localhost:9090/images/cdb4d9cb-f9f9-469c-b88c-649af9eaea8b",
	"object_attr_list": "http://localhost:9090/images/cdb4d9cb-f9f9-469c-b88c-649af9eaea8b/_attrs",
	"attr_latest_build": "http://localhost:9090/images/cdb4d9cb-f9f9-469c-b88c-649af9eaea8b/latest_build",
	"attr_latest_unpushed": "http://localhost:9090/images/cdb4d9cb-f9f9-469c-b88c-649af9eaea8b/latest_unpushed",
	"attr_object_type": "http://localhost:9090/images/cdb4d9cb-f9f9-469c-b88c-649af9eaea8b/object_type",
	"attr_template": "http://localhost:9090/images/cdb4d9cb-f9f9-469c-b88c-649af9eaea8b/template",
	"attr_uuid": "http://localhost:9090/images/cdb4d9cb-f9f9-469c-b88c-649af9eaea8b/uuid"
}


Additional info:
Comment 2 Brad P. Crochet 2012-02-29 16:02:09 EST
Factory uses the XML version. If conductor does as well, this is not a high priority for 1.0. If any other part of Aeolus uses json, this needs to be a blocker and fixed for 1.0.
Comment 3 Brad P. Crochet 2012-02-29 16:51:10 EST
Created attachment 566656 [details]
Remove attr_ from JSON template
Comment 4 Jim Meyering 2012-03-02 15:34:06 EST
Thanks for the report.
Here's a patch:

  http://thread.gmane.org/gmane.comp.lib.iwhd.devel/1094
Comment 6 wes hayutin 2012-04-13 17:46:29 EDT
json looks cleaned up


[root@apollo aeolus-conductor]# curl -H 'Accept: */json' http://localhost:9090/images/005ed09e-8402-11e1-afcd-0015172f2b30/_attrs
{
	"object_body": "http://localhost:9090/images/005ed09e-8402-11e1-afcd-0015172f2b30",
	"object_attr_list": "http://localhost:9090/images/005ed09e-8402-11e1-afcd-0015172f2b30/_attrs",
	"environment": "http://localhost:9090/images/005ed09e-8402-11e1-afcd-0015172f2b30/environment",
	"latest_build": "http://localhost:9090/images/005ed09e-8402-11e1-afcd-0015172f2b30/latest_build",
	"latest_unpushed": "http://localhost:9090/images/005ed09e-8402-11e1-afcd-0015172f2b30/latest_unpushed",
	"object_type": "http://localhost:9090/images/005ed09e-8402-11e1-afcd-0015172f2b30/object_type",
	"template": "http://localhost:9090/images/005ed09e-8402-11e1-afcd-0015172f2b30/template",
	"uuid": "http://localhost:9090/images/005ed09e-8402-11e1-afcd-0015172f2b30/uuid"
}
[root@apollo aeolus-conductor]# curl -H 'Accept: */xml' http://localhost:9090/images/15b837ae-85a2-11e1-9aec-0015172f2b30/_attrs
<object>
	<object_body path="http://localhost:9090/images/15b837ae-85a2-11e1-9aec-0015172f2b30"/>
	<object_attr_list path="http://localhost:9090/images/15b837ae-85a2-11e1-9aec-0015172f2b30/_attrs"/>
	<object_attr name="environment" path="http://localhost:9090/images/15b837ae-85a2-11e1-9aec-0015172f2b30/environment"/>
	<object_attr name="latest_unpushed" path="http://localhost:9090/images/15b837ae-85a2-11e1-9aec-0015172f2b30/latest_unpushed"/>
	<object_attr name="object_type" path="http://localhost:9090/images/15b837ae-85a2-11e1-9aec-0015172f2b30/object_type"/>
	<object_attr name="template" path="http://localhost:9090/images/15b837ae-85a2-11e1-9aec-0015172f2b30/template"/>
	<object_attr name="uuid" path="http://localhost:9090/images/15b837ae-85a2-11e1-9aec-0015172f2b30/uuid"/>
</object>
[root@apollo aeolus-conductor]# 

[root@apollo aeolus-conductor]# rpm -qa | grep iwhd
iwhd-1.5-2.el6.x86_64
[root@apollo aeolus-conductor]# rpm -qa | grep aeolus
rubygem-aeolus-cli-0.3.1-1.el6.noarch
rubygem-aeolus-image-0.3.0-12.el6.noarch
aeolus-conductor-0.8.7-1.el6.noarch
aeolus-conductor-daemons-0.8.7-1.el6.noarch
aeolus-conductor-doc-0.8.7-1.el6.noarch
aeolus-configure-2.5.2-1.el6.noarch
aeolus-all-0.8.7-1.el6.noarch
Comment 7 Jim Meyering 2012-04-17 09:35:07 EDT
As implied by comment#4 above, this fix is in iwhd-1.4.
Comment 9 errata-xmlrpc 2012-05-15 16:05:58 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2012-0589.html

Note You need to log in before you can comment on or make changes to this bug.