当前位置: 首页>>代码示例>>Python>>正文


Python block_device.new_format_is_ephemeral函数代码示例

本文整理汇总了Python中nova.block_device.new_format_is_ephemeral函数的典型用法代码示例。如果您正苦于以下问题:Python new_format_is_ephemeral函数的具体用法?Python new_format_is_ephemeral怎么用?Python new_format_is_ephemeral使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了new_format_is_ephemeral函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _transform

 def _transform(self):
     if not block_device.new_format_is_ephemeral(self._bdm_obj):
         raise _InvalidType
     self.update({
         'device_name': self._bdm_obj.device_name,
         'size': self._bdm_obj.volume_size or 0,
         'disk_bus': self._bdm_obj.disk_bus,
         'device_type': self._bdm_obj.device_type,
         'guest_format': self._bdm_obj.guest_format
     })
开发者ID:fufei,项目名称:nova,代码行数:10,代码来源:block_device.py

示例2: _transform

 def _transform(self, bdm):
     if not block_device.new_format_is_ephemeral(bdm):
         raise _InvalidType
     self.update({
         'device_name': bdm.get('device_name'),
         'size': bdm.get('volume_size') or 0,
         'disk_bus': bdm.get('disk_bus'),
         'device_type': bdm.get('device_type'),
         'guest_format': bdm.get('guest_format')
     })
开发者ID:Acidburn0zzz,项目名称:nova,代码行数:10,代码来源:block_device.py

示例3: _transform

 def _transform(self, bdm):
     if not block_device.new_format_is_ephemeral(bdm):
         raise _InvalidType
     self.update(
         {
             "device_name": bdm.get("device_name"),
             "size": bdm.get("volume_size", 0),
             "disk_bus": bdm.get("disk_bus"),
             "device_type": bdm.get("device_type"),
             "guest_format": bdm.get("guest_format"),
         }
     )
开发者ID:polettix,项目名称:nova,代码行数:12,代码来源:block_device.py

示例4: _transform

 def _transform(self):
     if not block_device.new_format_is_ephemeral(self._bdm_obj):
         raise _InvalidType
     self.update(
         {
             "device_name": self._bdm_obj.device_name,
             "size": self._bdm_obj.volume_size or 0,
             "disk_bus": self._bdm_obj.disk_bus,
             "device_type": self._bdm_obj.device_type,
             "guest_format": self._bdm_obj.guest_format,
         }
     )
开发者ID:noironetworks,项目名称:nova,代码行数:12,代码来源:block_device.py

示例5: _get_disk_metadata

    def _get_disk_metadata(self, instance, bdm):
        attachment_info = None
        if bdm.is_volume:
            attachment_info = self._get_vol_bdm_attachment_info(bdm)
        elif block_device.new_format_is_ephemeral(bdm):
            attachment_info = self._get_eph_bdm_attachment_info(
                instance, bdm)

        if not attachment_info:
            LOG.debug("No attachment info retrieved for bdm %s.", bdm)
            return

        tags = [bdm.tag] if bdm.tag else []
        bus = self._get_device_bus(
            attachment_info['controller_type'],
            attachment_info['controller_addr'],
            attachment_info['controller_slot'])
        serial = attachment_info.get('serial')

        return objects.DiskMetadata(bus=bus,
                                    tags=tags,
                                    serial=serial)
开发者ID:petrutlucian94,项目名称:compute-hyperv,代码行数:22,代码来源:block_device_manager.py

示例6: test_new_format_is_ephemeral

 def test_new_format_is_ephemeral(self):
     expected_results = [False, True, False, False, False]
     for expected, bdm in zip(expected_results, self.new_mapping):
         res = block_device.new_format_is_ephemeral(bdm)
         self.assertEqual(expected, res)
开发者ID:aaaaatoz,项目名称:nova,代码行数:5,代码来源:test_block_device.py


注:本文中的nova.block_device.new_format_is_ephemeral函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。