Add context information to download plugins

This patch sends the context information into the download plugins
via  kwargs.  This will allow download modules like swift to use
the keystone auth information.

Change-Id: I105cc7d7dd76e4eadfeefdc7ca65f9eab38098b7
blueprint: image-multiple-location
This commit is contained in:
John Bresnahan
2013-08-16 11:17:09 -10:00
parent 82e2a85bf2
commit 75179c2a05
3 changed files with 3 additions and 3 deletions

View File

@@ -20,6 +20,6 @@ from nova import exception
class TransferBase(object):
def download(self, url_parts, dst_path, metadata, **kwargs):
def download(self, context, url_parts, dst_path, metadata, **kwargs):
raise exception.ImageDownloadModuleNotImplementedError(
method_name='download')

View File

@@ -141,7 +141,7 @@ class FileTransfer(xfer_base.TransferBase):
new_path = path.replace(glance_mount, nova_mount, 1)
return new_path
def download(self, url_parts, dst_file, metadata, **kwargs):
def download(self, context, url_parts, dst_file, metadata, **kwargs):
self.filesystems = self._get_options()
if not self.filesystems:
#NOTE(jbresnah) when nothing is configured assume legacy behavior

View File

@@ -326,7 +326,7 @@ class GlanceImageService(object):
xfer_mod = self._get_transfer_module(o.scheme)
if xfer_mod:
try:
xfer_mod.download(o, dst_path, loc_meta)
xfer_mod.download(context, o, dst_path, loc_meta)
msg = _("Successfully transferred "
"using %s") % o.scheme
LOG.info(msg)