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


Python VmHost.set_storageVolumeIds方法代码示例

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


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

示例1: setUp

# 需要导入模块: from healthnmon.resourcemodel.healthnmonResourceModel import VmHost [as 别名]
# 或者: from healthnmon.resourcemodel.healthnmonResourceModel.VmHost import set_storageVolumeIds [as 别名]
    def setUp(self):
        super(StorageVolumeEventsTest, self).setUp()
        self.connection = LibvirtConnection(False)
        vmHost = VmHost()
        vmHost.set_storageVolumeIds([])
        InventoryCacheManager.update_object_in_cache('1', vmHost)
        self.connection._wrapped_conn = libvirt.open('qemu:///system')
        self.LibvirtStorageVolume = \
            LibvirtStorageVolume(self.connection._wrapped_conn, '1')
        self.LibvirtStorageVolume.vmHost = vmHost
        self.LibvirtStorageVolume.cur_total_storage_size = 0
        self.LibvirtStorageVolume.curr_storage_free = 0
        self.LibvirtStorageVolume.old_total_storage_size = 0
        self.LibvirtStorageVolume.old_storage_free = 0
        self.LibvirtStorageVolume.vmHost.set_id('1')
        self.connection.compute_rmcontext = \
            ComputeRMContext(rmType='KVM', rmIpAddress='10.10.155.165',
                             rmUserName='openstack',
                             rmPassword='password')
        self.flags(healthnmon_notification_drivers=[
            'nova.notifier.test_notifier'])
        test_notifier.NOTIFICATIONS = []
        self.mox.StubOutWithMock(nova_db, 'service_get_all_by_topic')

        nova_db.service_get_all_by_topic(
            mox.IgnoreArg(),
            mox.IgnoreArg()).MultipleTimes().AndReturn(None)
开发者ID:rakrup,项目名称:healthnmon,代码行数:29,代码来源:test_storage_events.py

示例2: setUp

# 需要导入模块: from healthnmon.resourcemodel.healthnmonResourceModel import VmHost [as 别名]
# 或者: from healthnmon.resourcemodel.healthnmonResourceModel.VmHost import set_storageVolumeIds [as 别名]
 def setUp(self):
     self.connection = LibvirtConnection(False)
     vmHost = VmHost()
     vmHost.set_storageVolumeIds([])
     InventoryCacheManager.update_object_in_cache('1', vmHost)
     self.connection._wrapped_conn = libvirt.open('qemu:///system')
     self.LibvirtStorageVolume = \
         LibvirtStorageVolume(self.connection._wrapped_conn, '1')
     self.connection.compute_rmcontext = \
         ComputeRMContext(rmType='KVM', rmIpAddress='10.10.155.165',
                          rmUserName='openstack',
                          rmPassword='password')
     self.mock = mox.Mox()
开发者ID:rakrup,项目名称:healthnmon,代码行数:15,代码来源:test_Inventory.py

示例3: setUp

# 需要导入模块: from healthnmon.resourcemodel.healthnmonResourceModel import VmHost [as 别名]
# 或者: from healthnmon.resourcemodel.healthnmonResourceModel.VmHost import set_storageVolumeIds [as 别名]
 def setUp(self):
     super(test_LibvirtStorage, self).setUp()
     self.connection = LibvirtConnection(False)
     vmHost = VmHost()
     vmHost.set_storageVolumeIds([])
     InventoryCacheManager.update_object_in_cache('1', vmHost)
     self.connection._wrapped_conn = libvirt.open('qemu:///system')
     self.LibvirtStorageVolume = \
         LibvirtStorageVolume(self.connection._wrapped_conn, '1')
     self.connection.compute_rmcontext = \
         ComputeRMContext(rmType='KVM', rmIpAddress='10.10.155.165',
                          rmUserName='openstack',
                          rmPassword='password')
     cfg.CONF.set_override('healthnmon_notification_drivers',
                           ['healthnmon.notifier.log_notifier'])
     self.mock = mox.Mox()
开发者ID:jessegonzalez,项目名称:healthnmon,代码行数:18,代码来源:test_Inventory.py


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