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:
@@ -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')
|
||||
|
@@ -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
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user