Merge "Add context information to download plugins"
This commit is contained in:
@@ -20,6 +20,6 @@ from nova import exception
|
|||||||
|
|
||||||
class TransferBase(object):
|
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(
|
raise exception.ImageDownloadModuleNotImplementedError(
|
||||||
method_name='download')
|
method_name='download')
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ class FileTransfer(xfer_base.TransferBase):
|
|||||||
new_path = path.replace(glance_mount, nova_mount, 1)
|
new_path = path.replace(glance_mount, nova_mount, 1)
|
||||||
return new_path
|
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()
|
self.filesystems = self._get_options()
|
||||||
if not self.filesystems:
|
if not self.filesystems:
|
||||||
#NOTE(jbresnah) when nothing is configured assume legacy behavior
|
#NOTE(jbresnah) when nothing is configured assume legacy behavior
|
||||||
|
|||||||
@@ -326,7 +326,7 @@ class GlanceImageService(object):
|
|||||||
xfer_mod = self._get_transfer_module(o.scheme)
|
xfer_mod = self._get_transfer_module(o.scheme)
|
||||||
if xfer_mod:
|
if xfer_mod:
|
||||||
try:
|
try:
|
||||||
xfer_mod.download(o, dst_path, loc_meta)
|
xfer_mod.download(context, o, dst_path, loc_meta)
|
||||||
msg = _("Successfully transferred "
|
msg = _("Successfully transferred "
|
||||||
"using %s") % o.scheme
|
"using %s") % o.scheme
|
||||||
LOG.info(msg)
|
LOG.info(msg)
|
||||||
|
|||||||
Reference in New Issue
Block a user