示例#1
0
    def fetch(self, instance):
        """Fetch the NVRAM from the storage service.

        :param instance: instance object
        :returns: the NVRAM data base64 encoded string
        """
        data, result = self._fetch(instance.uuid)
        if not data:
            raise api.NVRAMDownloadException(instance=instance.name,
                                             reason=result)
        return data
示例#2
0
    def fetch(self, instance):
        """Fetch the NVRAM from the storage service.

        :param instance: The nova instance object or instance UUID.
        :returns: the NVRAM data base64 encoded string
        """
        inst_uuid = (instance
                     if uuidutils.is_uuid_like(instance) else instance.uuid)
        data, result = self._fetch(inst_uuid)
        if not data:
            raise api.NVRAMDownloadException(instance=inst_uuid, reason=result)
        return data
示例#3
0
    def fetch(self, instance):
        """Fetch the NVRAM for an instance.

        :param instance: The instance to fetch the NVRAM for.
        :returns: The NVRAM data for the instance.
        """
        try:
            return self._api.fetch(instance)
        except Exception as e:
            LOG.exception('Could not update NVRAM.', instance=instance)
            raise api.NVRAMDownloadException(instance=instance.name,
                                             reason=six.text_type(e))
示例#4
0
    def fetch(self, instance):
        """Fetch the NVRAM for an instance.

        :param instance: The instance UUID OR instance object of the instance
                         to fetch the NVRAM for.
        :returns: The NVRAM data for the instance.
        """
        inst_uuid = (instance
                     if uuidutils.is_uuid_like(instance) else instance.uuid)
        try:
            return self._api.fetch(inst_uuid)
        except Exception as e:
            LOG.exception(('Could not fetch NVRAM for instance with UUID %s.'),
                          inst_uuid)
            raise api.NVRAMDownloadException(instance=inst_uuid,
                                             reason=six.text_type(e))