本文整理汇总了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())
示例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())
示例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())
示例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())
示例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())
示例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())
示例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())