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


Python DataSourceAltCloud.get_cloud_type方法代码示例

本文整理汇总了Python中cloudinit.sources.DataSourceAltCloud.get_cloud_type方法的典型用法代码示例。如果您正苦于以下问题:Python DataSourceAltCloud.get_cloud_type方法的具体用法?Python DataSourceAltCloud.get_cloud_type怎么用?Python DataSourceAltCloud.get_cloud_type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cloudinit.sources.DataSourceAltCloud的用法示例。


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

示例1: test_vsphere

# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import get_cloud_type [as 别名]
 def test_vsphere(self):
     '''
     Test method get_cloud_type() for vSphere systems.
     Forcing read_dmi_data return to match a vSphere system: RHEV Hypervisor
     '''
     util.read_dmi_data = _dmi_data('VMware Virtual Platform')
     dsrc = DataSourceAltCloud({}, None, self.paths)
     self.assertEqual('VSPHERE', dsrc.get_cloud_type())
开发者ID:BenjaminSchiborr,项目名称:cloud-init,代码行数:10,代码来源:test_altcloud.py

示例2: test_unknown

# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import get_cloud_type [as 别名]
 def test_unknown(self):
     '''
     Test method get_cloud_type() for unknown systems.
     Forcing read_dmi_data return to match an unrecognized return.
     '''
     util.read_dmi_data = _dmi_data('Unrecognized Platform')
     dsrc = DataSourceAltCloud({}, None, self.paths)
     self.assertEqual('UNKNOWN', dsrc.get_cloud_type())
开发者ID:BenjaminSchiborr,项目名称:cloud-init,代码行数:10,代码来源:test_altcloud.py

示例3: test_rhev

# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import get_cloud_type [as 别名]
 def test_rhev(self):
     '''
     Test method get_cloud_type() for RHEVm systems.
     Forcing read_dmi_data return to match a RHEVm system: RHEV Hypervisor
     '''
     util.read_dmi_data = _dmi_data('RHEV')
     dsrc = DataSourceAltCloud({}, None, self.paths)
     self.assertEqual('RHEV', dsrc.get_cloud_type())
开发者ID:BenjaminSchiborr,项目名称:cloud-init,代码行数:10,代码来源:test_altcloud.py

示例4: test_exception2

# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import get_cloud_type [as 别名]
 def test_exception2(self):
     '''
     Test method get_cloud_type() where command dmidecode is not available.
     '''
     cloudinit.sources.DataSourceAltCloud.CMD_DMI_SYSTEM = \
         ['bad command']
     dsrc = DataSourceAltCloud({}, None, self.paths)
     self.assertEquals('UNKNOWN', \
         dsrc.get_cloud_type())
开发者ID:Esysc,项目名称:cloud-init-0.7.5,代码行数:11,代码来源:test_altcloud.py

示例5: test_unknown

# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import get_cloud_type [as 别名]
 def test_unknown(self):
     '''
     Test method get_cloud_type() for unknown systems.
     Forcing dmidecode return to match an unrecognized return.
     '''
     cloudinit.sources.DataSourceAltCloud.CMD_DMI_SYSTEM = \
         ['echo', 'Unrecognized Platform']
     dsrc = DataSourceAltCloud({}, None, self.paths)
     self.assertEquals('UNKNOWN', \
         dsrc.get_cloud_type())
开发者ID:Esysc,项目名称:cloud-init-0.7.5,代码行数:12,代码来源:test_altcloud.py

示例6: test_vsphere

# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import get_cloud_type [as 别名]
 def test_vsphere(self):
     '''
     Test method get_cloud_type() for vSphere systems.
     Forcing dmidecode return to match a vSphere system: RHEV Hypervisor
     '''
     cloudinit.sources.DataSourceAltCloud.CMD_DMI_SYSTEM = \
         ['echo', 'VMware Virtual Platform']
     dsrc = DataSourceAltCloud({}, None, self.paths)
     self.assertEquals('VSPHERE', \
         dsrc.get_cloud_type())
开发者ID:Esysc,项目名称:cloud-init-0.7.5,代码行数:12,代码来源:test_altcloud.py

示例7: test_rhev

# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import get_cloud_type [as 别名]
 def test_rhev(self):
     '''
     Test method get_cloud_type() for RHEVm systems.
     Forcing dmidecode return to match a RHEVm system: RHEV Hypervisor
     '''
     cloudinit.sources.DataSourceAltCloud.CMD_DMI_SYSTEM = \
         ['echo', 'RHEV Hypervisor']
     dsrc = DataSourceAltCloud({}, None, self.paths)
     self.assertEquals('RHEV', \
         dsrc.get_cloud_type())
开发者ID:Esysc,项目名称:cloud-init-0.7.5,代码行数:12,代码来源:test_altcloud.py


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