~ubuntu-cloud-archive/ubuntu/precise/nova/trunk

« back to all changes in this revision

Viewing changes to nova/image/s3.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Adam Gandelman, Chuck Short
  • Date: 2012-07-06 10:18:33 UTC
  • mfrom: (1.1.58)
  • Revision ID: package-import@ubuntu.com-20120706101833-wp2nv392mpe9re8p
Tags: 2012.2~f2-0ubuntu1
[ Adam Gandelman ]
* Use new rootwrap configuration structure:
  - debian/nova-{compute, network, volume}.{pyinstall, pyremove}: Dropped.
  - debian/nova-common.dirs: Add /etc/nova/rootwrap.d/.
  - debian/nova-common.install: Install /etc/nova/rootwrap.conf.
  - debian/debian/nova.conf: Reference rootwrap.conf in calls to
    nova-rootwrap.
  - debian/nova-{compute, network, volume}.install: Install corresponding
    filter in /etc/nova/rootwrap.d/
* debian/rules: Install logging_sample.conf to /etc/nova/logging.conf
  as part of nova-common.
* debian/pydist-overrides: Add setuptools-git.
* debian/control: Add python-setuptools-git as a Build-Depends.
* debian/rules: Do not remove nova.egg-info during auto_clean.  Now that
  upstream has moved to setuptools-git, doing so results in missing files
  from built package.

[ Chuck Short ]
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
import nova.cert.rpcapi
34
34
from nova import exception
35
35
from nova import flags
36
 
from nova import image
37
 
from nova import log as logging
 
36
from nova.image import glance
38
37
from nova.openstack.common import cfg
 
38
from nova.openstack.common import log as logging
39
39
from nova import utils
40
40
 
41
41
 
69
69
 
70
70
    def __init__(self, service=None, *args, **kwargs):
71
71
        self.cert_rpcapi = nova.cert.rpcapi.CertAPI()
72
 
        self.service = service or image.get_default_image_service()
 
72
        self.service = service or glance.get_default_image_service()
73
73
        self.service.__init__(*args, **kwargs)
74
74
 
75
75
    def _translate_uuids_to_ids(self, context, images):
136
136
        image = self.service.update(context, image_uuid, metadata, data)
137
137
        return self._translate_uuid_to_id(context, image)
138
138
 
139
 
    def index(self, context):
140
 
        #NOTE(bcwaldon): sort asc to make sure we assign lower ids
141
 
        # to older images
142
 
        images = self.service.index(context, sort_dir='asc')
143
 
        return self._translate_uuids_to_ids(context, images)
144
 
 
145
 
    def detail(self, context):
146
 
        #NOTE(bcwaldon): sort asc to make sure we assign lower ids
147
 
        # to older images
148
 
        images = self.service.detail(context, sort_dir='asc')
 
139
    def detail(self, context, **kwargs):
 
140
        #NOTE(bcwaldon): sort asc to make sure we assign lower ids
 
141
        # to older images
 
142
        kwargs.setdefault('sort_dir', 'asc')
 
143
        images = self.service.detail(context, **kwargs)
149
144
        return self._translate_uuids_to_ids(context, images)
150
145
 
151
146
    def show(self, context, image_id):
153
148
        image = self.service.show(context, image_uuid)
154
149
        return self._translate_uuid_to_id(context, image)
155
150
 
156
 
    def show_by_name(self, context, name):
157
 
        image = self.service.show_by_name(context, name)
158
 
        return self._translate_uuid_to_id(context, image)
159
 
 
160
151
    @staticmethod
161
152
    def _conn(context):
162
153
        # NOTE(vish): access and secret keys for s3 server are not