format_images in ec2_api does not correctly return owner id

Bug #798998 reported by Vish Ishaya
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Vish Ishaya

Bug Description

This line in api/ec2/cloud.py:
1032 i['imageOwnerId'] = image['properties'].get('owner_id')
should be
1032 i['imageOwnerId'] = image['properties'].get('project_id')
since there is no owner_id field set anywhere

Tags: ec2
Thierry Carrez (ttx)
Changed in nova:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Dave Walker (davewalker) wrote :

Is this a dupe of bug 827386?

Thanks.

Revision history for this message
Everett Toews (everett-toews) wrote : Re: [Bug 798998] Re: format_images in ec2_api does not correctly return owner id

Not exact duplicates as I was using Glance and Scott was using
nova-objectstore. Either way the image owner needs to be returned.

On Sat, Aug 20, 2011 at 9:12 AM, Dave Walker <email address hidden> wrote:

> Is this a dupe of bug 827386?
>
> Thanks.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/798998
>
> Title:
> format_images in ec2_api does not correctly return owner id
>
> Status in OpenStack Compute (Nova):
> Triaged
>
> Bug description:
> This line in api/ec2/cloud.py:
> 1032 i['imageOwnerId'] = image['properties'].get('owner_id')
> should be
> 1032 i['imageOwnerId'] = image['properties'].get('project_id')
> since there is no owner_id field set anywhere
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/nova/+bug/798998/+subscriptions
>

Chuck Short (zulcss)
tags: added: ec2
Revision history for this message
Kevin Jackson (kevin-linuxservices) wrote :

This affects me too, but I'm having no joy with the one-liner fix.

I am using Diablo on Ubuntu 11.10 and edited /usr/lib/python2.7/dist-packages/nova/api/ec2/cloud.py
Restarted services but still get the following when I issue the following

euca-modify-image-attribute ami-00000002 -l

The problem I have is that my images are being uploaded as private and I need to be able to change them to public so all projects can use them.

2011-12-11 13:51:44,855 ERROR nova.api [e609cca1-370c-46b5-a86c-d914e8409ad3 openstack example] ApiError raised: user or group not specified
(nova.api): TRACE: Traceback (most recent call last):
(nova.api): TRACE: File "/usr/lib/python2.7/dist-packages/nova/api/ec2/__init__.py", line 348, in __call__
(nova.api): TRACE: result = api_request.invoke(context)
(nova.api): TRACE: File "/usr/lib/python2.7/dist-packages/nova/api/ec2/apirequest.py", line 78, in invoke
(nova.api): TRACE: result = method(context, **args)
(nova.api): TRACE: File "/usr/lib/python2.7/dist-packages/nova/api/ec2/cloud.py", line 1640, in modify_image_attribute
(nova.api): TRACE: raise exception.ApiError(_('user or group not specified'))
(nova.api): TRACE: ApiError: user or group not specified
(nova.api): TRACE:
2011-12-11 13:51:44,856 ERROR nova.api [e609cca1-370c-46b5-a86c-d914e8409ad3 openstack example] ApiError: user or group not specified
2011-12-11 13:51:44,857 INFO nova.api [e609cca1-370c-46b5-a86c-d914e8409ad3 openstack example] 0.23183s 172.16.0.253 POST /services/Cloud/ CloudController:ModifyImageAttribute 400 [Boto/2.0 (linux2)] application/x-www-form-urlencoded text/xml

Changed in nova:
milestone: none → essex-rc1
Revision history for this message
Vish Ishaya (vishvananda) wrote :

now that images in glance have an owner field, I think i['imageOwnerId'] = image.get('owner') is even better. In fact, we could even stop storing properties['project_id'] as well in s3 register. It definitely won't be set for image uploaded directly to glance.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/5186

Changed in nova:
assignee: nobody → Vish Ishaya (vishvananda)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/5186
Committed: http://github.com/openstack/nova/commit/a6ac8af69351cb39aa07f53e3327ff29b90383bc
Submitter: Jenkins
Branch: master

commit a6ac8af69351cb39aa07f53e3327ff29b90383bc
Author: Vishvananda Ishaya <email address hidden>
Date: Fri Mar 9 18:19:29 2012 -0800

    Display owner in ec2 describe images

     * use owner field from glance
     * remove unneccessary project_id field in s3 registration
     * fixes bug 798998

    Change-Id: I8d88ff258b914899212d63a7d31d83722d0cb559

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: essex-rc1 → 2012.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.