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


Python VirtualSwitch.get_name方法代码示例

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


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

示例1: test_PortGroup_Reconfigured_Event

# 需要导入模块: from healthnmon.resourcemodel.healthnmonResourceModel import VirtualSwitch [as 别名]
# 或者: from healthnmon.resourcemodel.healthnmonResourceModel.VirtualSwitch import get_name [as 别名]
 def test_PortGroup_Reconfigured_Event(self):
     cachedHost = VmHost()
     cachedHost.id = self.libvirtNetwork.compute_id
     vswitch = VirtualSwitch()
     vswitch.set_id("11")
     vswitch.set_name("vs1")
     portGroup = PortGroup()
     portGroup.set_id("PortGroup_" + vswitch.get_id())
     portGroup.set_name(vswitch.get_name())
     portGroup.set_virtualSwitchId(vswitch.get_id())
     vswitch.set_portGroups([portGroup])
     cachedHost.set_virtualSwitches([vswitch])
     cachedHost.set_portGroups([portGroup])
     vmhost = copy.deepcopy(cachedHost)
     vmhost.get_portGroups()[0].set_name("vs11")
     vmhost.get_virtualSwitches()[0].set_name("vs11")
     vmhost.get_virtualSwitches()[0].get_portGroups()[0].set_name("vs11")
     self.libvirtNetwork._processNetworkEvents(cachedHost, vmhost)
     self.assertEquals(len(test_notifier.NOTIFICATIONS), 1)
     msg = test_notifier.NOTIFICATIONS[0]
     self.assertEquals(msg['priority'], notifier_api.INFO)
     event_type = event_metadata.get_EventMetaData(
         event_metadata.EVENT_TYPE_PORTGROUP_RECONFIGURED)
     self.assertEquals(msg['event_type'],
                       event_type.get_event_fully_qal_name())
     payload = msg['payload']
     self.assertEquals(payload['entity_type'], 'PortGroup')
     self.assertEquals(payload['entity_id'], portGroup.get_id())
开发者ID:emonty,项目名称:healthnmon,代码行数:30,代码来源:test_network_events.py

示例2: test_portGroup_deleted_event

# 需要导入模块: from healthnmon.resourcemodel.healthnmonResourceModel import VirtualSwitch [as 别名]
# 或者: from healthnmon.resourcemodel.healthnmonResourceModel.VirtualSwitch import get_name [as 别名]
 def test_portGroup_deleted_event(self):
     cachedHost = VmHost()
     cachedHost.id = self.libvirtNetwork.compute_id
     vswitch = VirtualSwitch()
     vswitch.set_id("11")
     vswitch.set_name("vs1")
     portGroup = PortGroup()
     portGroup.set_id("PortGroup_" + vswitch.get_id())
     portGroup.set_name(vswitch.get_name())
     portGroup.set_virtualSwitchId(vswitch.get_id())
     vswitch.set_portGroups([portGroup])
     cachedHost.set_virtualSwitches([vswitch])
     cachedHost.set_portGroups([portGroup])
     vmhost = copy.deepcopy(cachedHost)
     vmhost.get_portGroups().pop()
     vmhost.get_virtualSwitches().pop()
     self.assertEquals(vmhost.get_virtualSwitches(), [])
     self.libvirtNetwork._processNetworkEvents(cachedHost, vmhost)
     self.assertEquals(len(test_notifier.NOTIFICATIONS), 2)
     msg = test_notifier.NOTIFICATIONS[1]
     self.assertEquals(msg["priority"], notifier_api.INFO)
     event_type = event_metadata.get_EventMetaData(event_metadata.EVENT_TYPE_PORTGROUP_DELETED)
     self.assertEquals(msg["event_type"], event_type.get_event_fully_qal_name())
     payload = msg["payload"]
     self.assertEquals(payload["entity_type"], "PortGroup")
     self.assertEquals(payload["entity_id"], portGroup.get_id())
开发者ID:jessegonzalez,项目名称:healthnmon,代码行数:28,代码来源:test_network_events.py


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