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


Python DataSourceAltCloud.get_data方法代码示例

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


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

示例1: test_vsphere_no_cloud_file

# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import get_data [as 别名]
    def test_vsphere_no_cloud_file(self):
        '''Test No cloud info file module get_data() forcing VSPHERE.'''

        util.read_dmi_data = _dmi_data('VMware Virtual Platform')
        dsrc = DataSourceAltCloud({}, None, self.paths)
        dsrc.user_data_vsphere = lambda: True
        self.assertEquals(True, dsrc.get_data())
开发者ID:broble,项目名称:cloud-init-rax-pkg,代码行数:9,代码来源:test_altcloud.py

示例2: test_fail_rhev

# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import get_data [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())
开发者ID:broble,项目名称:cloud-init-rax-pkg,代码行数:9,代码来源:test_altcloud.py

示例3: test_rhev_no_cloud_file

# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import get_data [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())
开发者ID:broble,项目名称:cloud-init-rax-pkg,代码行数:9,代码来源:test_altcloud.py

示例4: test_fail_vsphere

# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import get_data [as 别名]
    def test_fail_vsphere(self):
        '''Failure Test module get_data() forcing VSPHERE.'''

        _write_cloud_info_file('VSPHERE')
        dsrc = DataSourceAltCloud({}, None, self.paths)
        dsrc.user_data_vsphere = lambda: False
        self.assertEquals(False, dsrc.get_data())
开发者ID:broble,项目名称:cloud-init-rax-pkg,代码行数:9,代码来源:test_altcloud.py

示例5: test_vsphere

# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import get_data [as 别名]
    def test_vsphere(self):
        '''Success Test module get_data() forcing VSPHERE.'''

        _write_cloud_info_file('VSPHERE')
        dsrc = DataSourceAltCloud({}, None, self.paths)
        dsrc.user_data_vsphere = lambda: True
        self.assertEquals(True, dsrc.get_data())
开发者ID:broble,项目名称:cloud-init-rax-pkg,代码行数:9,代码来源:test_altcloud.py

示例6: test_rhev

# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import get_data [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())
开发者ID:broble,项目名称:cloud-init-rax-pkg,代码行数:9,代码来源:test_altcloud.py

示例7: test_failure_no_cloud_file

# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import get_data [as 别名]
    def test_failure_no_cloud_file(self):
        '''Test No cloud info file module get_data() forcing unrecognized.'''

        cloudinit.sources.DataSourceAltCloud.CMD_DMI_SYSTEM = \
            ['echo', 'Unrecognized Platform']
        dsrc = DataSourceAltCloud({}, None, self.paths)
        self.assertEquals(False, dsrc.get_data())
开发者ID:Esysc,项目名称:cloud-init-0.7.5,代码行数:9,代码来源:test_altcloud.py

示例8: test_vsphere_no_cloud_file

# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import get_data [as 别名]
    def test_vsphere_no_cloud_file(self):
        '''Test No cloud info file module get_data() forcing VSPHERE.'''

        cloudinit.sources.DataSourceAltCloud.CMD_DMI_SYSTEM = \
            ['echo', 'VMware Virtual Platform']
        dsrc = DataSourceAltCloud({}, None, self.paths)
        dsrc.user_data_vsphere = lambda: True
        self.assertEquals(True, dsrc.get_data())
开发者ID:Esysc,项目名称:cloud-init-0.7.5,代码行数:10,代码来源:test_altcloud.py

示例9: test_rhev_no_cloud_file

# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import get_data [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())
开发者ID:Esysc,项目名称:cloud-init-0.7.5,代码行数:10,代码来源:test_altcloud.py

示例10: test_failure_no_cloud_file

# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import get_data [as 别名]
    def test_failure_no_cloud_file(self):
        '''Test No cloud info file module get_data() forcing unrecognized.'''

        util.read_dmi_data = _dmi_data('Unrecognized Platform')
        dsrc = DataSourceAltCloud({}, None, self.paths)
        self.assertEquals(False, dsrc.get_data())
开发者ID:broble,项目名称:cloud-init-rax-pkg,代码行数:8,代码来源:test_altcloud.py

示例11: test_unrecognized

# 需要导入模块: from cloudinit.sources import DataSourceAltCloud [as 别名]
# 或者: from cloudinit.sources.DataSourceAltCloud import get_data [as 别名]
    def test_unrecognized(self):
        '''Failure Test module get_data() forcing unrecognized.'''

        _write_cloud_info_file('unrecognized')
        dsrc = DataSourceAltCloud({}, None, self.paths)
        self.assertEquals(False, dsrc.get_data())
开发者ID:broble,项目名称:cloud-init-rax-pkg,代码行数:8,代码来源:test_altcloud.py


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