本文整理汇总了Python中cloudinit.sources.DataSourceAltCloud.user_data_rhevm方法的典型用法代码示例。如果您正苦于以下问题:Python DataSourceAltCloud.user_data_rhevm方法的具体用法?Python DataSourceAltCloud.user_data_rhevm怎么用?Python DataSourceAltCloud.user_data_rhevm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cloudinit.sources.DataSourceAltCloud
的用法示例。
在下文中一共展示了DataSourceAltCloud.user_data_rhevm方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_rhev_no_cloud_file
# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import user_data_rhevm [as 别名]
def test_rhev_no_cloud_file(self):
'''Test No cloud info file module get_data() forcing RHEV.'''
util.read_dmi_data = _dmi_data('RHEV Hypervisor')
dsrc = DataSourceAltCloud({}, None, self.paths)
dsrc.user_data_rhevm = lambda: True
self.assertEquals(True, dsrc.get_data())
示例2: test_fail_rhev
# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import user_data_rhevm [as 别名]
def test_fail_rhev(self):
'''Failure Test module get_data() forcing RHEV.'''
_write_cloud_info_file('RHEV')
dsrc = DataSourceAltCloud({}, None, self.paths)
dsrc.user_data_rhevm = lambda: False
self.assertEquals(False, dsrc.get_data())
示例3: test_rhev
# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import user_data_rhevm [as 别名]
def test_rhev(self):
'''Success Test module get_data() forcing RHEV.'''
_write_cloud_info_file('RHEV')
dsrc = DataSourceAltCloud({}, None, self.paths)
dsrc.user_data_rhevm = lambda: True
self.assertEquals(True, dsrc.get_data())
示例4: test_rhev_no_cloud_file
# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import user_data_rhevm [as 别名]
def test_rhev_no_cloud_file(self):
'''Test No cloud info file module get_data() forcing RHEV.'''
cloudinit.sources.DataSourceAltCloud.CMD_DMI_SYSTEM = \
['echo', 'RHEV Hypervisor']
dsrc = DataSourceAltCloud({}, None, self.paths)
dsrc.user_data_rhevm = lambda: True
self.assertEquals(True, dsrc.get_data())
示例5: test_no_udevadm_cmd
# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import user_data_rhevm [as 别名]
def test_no_udevadm_cmd(self):
'''Test user_data_rhevm() with no udevadm command.'''
cloudinit.sources.DataSourceAltCloud.CMD_UDEVADM_SETTLE = \
['bad command', 'udevadm floppy']
dsrc = DataSourceAltCloud({}, None, self.paths)
self.assertEquals(False, dsrc.user_data_rhevm())
示例6: test_udevadm_fails
# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import user_data_rhevm [as 别名]
def test_udevadm_fails(self):
'''Test user_data_rhevm() where udevadm fails.'''
cloudinit.sources.DataSourceAltCloud.CMD_UDEVADM_SETTLE = \
['ls', 'udevadm floppy']
dsrc = DataSourceAltCloud({}, None, self.paths)
self.assertEquals(False, dsrc.user_data_rhevm())
示例7: test_no_modprobe_cmd
# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import user_data_rhevm [as 别名]
def test_no_modprobe_cmd(self):
'''Test user_data_rhevm() with no modprobe command.'''
cloudinit.sources.DataSourceAltCloud.CMD_PROBE_FLOPPY = \
['bad command', 'modprobe floppy']
dsrc = DataSourceAltCloud({}, None, self.paths)
self.assertEquals(False, dsrc.user_data_rhevm())
示例8: test_modprobe_fails
# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import user_data_rhevm [as 别名]
def test_modprobe_fails(self):
'''Test user_data_rhevm() where modprobe fails.'''
cloudinit.sources.DataSourceAltCloud.CMD_PROBE_FLOPPY = \
['ls', 'modprobe floppy']
dsrc = DataSourceAltCloud({}, None, self.paths)
self.assertEquals(False, dsrc.user_data_rhevm())