Ejemplo n.º 1
0
Archivo: file.py Proyecto: noorul/nova
 def _normalize_destination(self, nova_mount, glance_mount, path):
     if not path.startswith(glance_mount):
         msg = _('The mount point advertised by glance: %(glance_mount)s, '
                 'does not match the URL path: %(path)s') % locals()
         raise exception.ImageDownloadModuleMetaDataError(
             module=str(self), reason=msg)
     new_path = path.replace(glance_mount, nova_mount, 1)
     return new_path
Ejemplo n.º 2
0
Archivo: file.py Proyecto: noorul/nova
 def _file_system_lookup(self, metadata, url_parts):
     for r in self.desc_required_keys:
         if r not in metadata:
             url = url_parts.geturl()
             msg = _('The key %(r)s is required in the location metadata '
                     'to access the url %(url)s.') % locals()
             LOG.info(msg)
             raise exception.ImageDownloadModuleMetaDataError(
                 module=str(self), reason=msg)
     fs_descriptor = self.filesystems[metadata['id']]
     return fs_descriptor
Ejemplo n.º 3
0
 def _file_system_lookup(self, metadata, url_parts):
     for r in self.desc_required_keys:
         if r not in metadata:
             url = url_parts.geturl()
             msg = _('The key %(r)s is required in the location metadata '
                     'to access the url %(url)s.') % {'r': r, 'url': url}
             LOG.info(msg)
             raise exception.ImageDownloadModuleMetaDataError(
                 module=str(self), reason=msg)
     id = metadata['id']
     if id not in self.filesystems:
         msg = _('The ID %(id)s is unknown.') % {'id': id}
         LOG.info(msg)
         return
     fs_descriptor = self.filesystems[id]
     return fs_descriptor