本文整理匯總了Python中Mgmt.event方法的典型用法代碼示例。如果您正苦於以下問題:Python Mgmt.event方法的具體用法?Python Mgmt.event怎麽用?Python Mgmt.event使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Mgmt
的用法示例。
在下文中一共展示了Mgmt.event方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: sendVmnetEvent
# 需要導入模塊: import Mgmt [as 別名]
# 或者: from Mgmt import event [as 別名]
def sendVmnetEvent(self, eventName):
binding = ("interface", "string", self.vmnetReal)
Mgmt.open()
Mgmt.event(eventName, binding)
Mgmt.close()
Logging.log(Logging.LOG_INFO, "Event %s on interface %s sent" % (
eventName, self.vmnetReal))
示例2: generate_mgmt_event
# 需要導入模塊: import Mgmt [as 別名]
# 或者: from Mgmt import event [as 別名]
def generate_mgmt_event(event, reason, version_info):
"""!
Generate Mgmt event.
"""
binding_to_send = None
if event == READY_EVENT:
binding_to_send = ("version_info", "string", version_info)
elif event == DISCONNECTED_EVENT:
binding_to_send = ("reason", "string", reason)
else:
Logging.log(Logging.LOG_ERR, "Unknown event")
# suicide!
sys.exit()
Mgmt.event(event, binding_to_send)