• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python events.emit函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pumphouse.events.emit函数的典型用法代码示例。如果您正苦于以下问题:Python emit函数的具体用法?Python emit怎么用?Python emit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: reassign

    def reassign():
        # NOTE(akscram): Initialization of fuelclient.
        fuel_config = flask.current_app.config["CLOUDS"]["fuel"]["endpoint"]
        os.environ["SERVER_ADDRESS"] = fuel_config["host"]
        os.environ["LISTEN_PORT"] = str(fuel_config["port"])
        os.environ["KEYSTONE_USER"] = fuel_config["username"]
        os.environ["KEYSTONE_PASS"] = fuel_config["password"]

        src_config = hooks.source.config()
        dst_config = hooks.destination.config()
        config = {
            "source": src_config["environment"],
            "destination": dst_config["environment"],
        }

        try:
            src = hooks.source.connect()
            dst = hooks.destination.connect()
            ctx = context.Context(config, src, dst)

            flow = node_tasks.reassign_node(ctx, host_id)
            LOG.debug("Reassigning flow: %s", flow)
            result = flows.run_flow(flow, ctx.store)
            LOG.debug("Result of migration: %s", result)
        except Exception:
            msg = ("Error is occured during reassigning host {}"
                   .format(host_id))
            LOG.exception(msg)
            events.emit("error", {
                "message": msg,
            }, namespace="/events")
开发者ID:UshF,项目名称:pumphouse,代码行数:31,代码来源:handlers.py


示例2: created_event

 def created_event(self, flavor):
     LOG.info("Flavor created: %s", flavor.id)
     events.emit(
         "create",
         {"id": flavor.id, "type": "flavor", "cloud": self.cloud.name, "data": flavor.to_dict()},
         namespace="/events",
     )
开发者ID:pombredanne,项目名称:pumphouse,代码行数:7,代码来源:flavor.py


示例3: unassign_start_event

 def unassign_start_event(self, node):
     events.emit("update", {
         "id": extract_hostname(node.data),
         "cloud": self.cloud.name,
         "type": "host",
         "action": "reassignment",
     }, namespace="/events")
开发者ID:UshF,项目名称:pumphouse,代码行数:7,代码来源:node.py


示例4: delete_event

 def delete_event(self, keypair_info):
     LOG.info("Deleted keypair: %s", keypair_info["name"])
     events.emit(
         "delete",
         {"id": keypair_info["name"], "type": "keypair", "cloud": self.cloud.name, "data": None},
         namespace="/events",
     )
开发者ID:pombredanne,项目名称:pumphouse,代码行数:7,代码来源:keypair.py


示例5: create_event

 def create_event(self, keypair):
     LOG.info("Created keypair: %s", keypair.name)
     events.emit(
         "create",
         {"id": keypair.name, "type": "keypair", "cloud": self.cloud.name, "data": keypair.to_dict()},
         namespace="/events",
     )
开发者ID:pombredanne,项目名称:pumphouse,代码行数:7,代码来源:keypair.py


示例6: created_event

 def created_event(self, secgroup_info):
     events.emit("create", {
         "id": secgroup_info["id"],
         "type": "secgroup",
         "cloud": self.cloud.name,
         "data": secgroup_info,
     }, namespace="/events")
开发者ID:pombredanne,项目名称:pumphouse,代码行数:7,代码来源:secgroup.py


示例7: upload_to_glance_event

 def upload_to_glance_event(self, image_info):
     LOG.info("Created: %s", image_info)
     events.emit("create", {
         "id": image_info["id"],
         "cloud": self.cloud.name,
         "type": "image",
         "data": dict(image_info)
     }, namespace="/events")
开发者ID:rmoe,项目名称:pumphouse,代码行数:8,代码来源:volume.py


示例8: upload_to_glance_event

 def upload_to_glance_event(self, image_info):
     LOG.info("Created: %s", image_info)
     events.emit("volume snapshot create", {
         "cloud": self.cloud.name,
         "id": image_info["id"],
         "name": image_info["name"],
         "status": "active",
     }, namespace="/events")
开发者ID:UshF,项目名称:pumphouse,代码行数:8,代码来源:volume.py


示例9: created_event

 def created_event(self, floating_ip):
     events.emit("create", {
         "id": floating_ip.address,
         "type": "floating_ip",
         "cloud": self.cloud.name,
         "data": dict(floating_ip.to_dict(),
                      name=floating_ip.address),
     }, namespace="/events")
开发者ID:UshF,项目名称:pumphouse,代码行数:8,代码来源:floating_ip.py


示例10: update_event

 def update_event(self, service):
     events.emit("update", {
         "id": service["host"],
         "cloud": self.cloud.name,
         "type": "host",
         "progress": None,
         "action": None,
     }, namespace="/events")
开发者ID:UshF,项目名称:pumphouse,代码行数:8,代码来源:node.py


示例11: resume_event

 def resume_event(self, server):
     LOG.info("Server resumed: %s", server["id"])
     events.emit("update", {
         "id": server["id"],
         "cloud": self.cloud.name,
         "type": "server",
         "data": server,
     }, namespace="/events")
开发者ID:rmoe,项目名称:pumphouse,代码行数:8,代码来源:server.py


示例12: execute

 def execute(self, server_id):
     LOG.info("Migration of server %r started", server_id)
     events.emit("update", {
         "id": server_id,
         "cloud": self.cloud.name,
         "type": "server",
         "action": "migration",
     }, namespace="/events")
开发者ID:rmoe,项目名称:pumphouse,代码行数:8,代码来源:server.py


示例13: created_event

 def created_event(self, tenant):
     LOG.info("Tenant created: %s", tenant.id)
     events.emit("create", {
         "id": tenant.id,
         "type": "tenant",
         "cloud": self.cloud.name,
         "data": tenant.to_dict(),
     }, namespace="/events")
开发者ID:pombredanne,项目名称:pumphouse,代码行数:8,代码来源:tenant.py


示例14: created_event

 def created_event(self, snapshot):
     events.emit("create", {
         "id": snapshot["id"],
         "type": "image",
         "cloud": self.cloud.name,
         "action": "uploading",
         "data": dict(snapshot),
     }, namespace="/events")
开发者ID:pombredanne,项目名称:pumphouse,代码行数:8,代码来源:snapshot.py


示例15: created_event

 def created_event(self, user):
     LOG.info("Created user: %s", user)
     events.emit("create", {
         "id": user.id,
         "type": "user",
         "cloud": self.cloud.name,
         "data": user.to_dict(),
     }, namespace="/events")
开发者ID:pombredanne,项目名称:pumphouse,代码行数:8,代码来源:user.py


示例16: execute

 def execute(self, volume, target_host):
     LOG.info("Evacuating volume %s to host %s...", volume.id, target_host)
     self.cloud.cinder.volumes.migrate_volume(volume, target_host, False)
     volume = utils.wait_for(volume.id, self.cloud.cinder.volumes.get,
                             get_volume_host, target_host)
     events.emit("update", event_from(self.cloud, volume),
                 namespace="/events")
     LOG.info("Evacuated volume %s to host %s", volume.id, target_host)
开发者ID:pombredanne,项目名称:pumphouse,代码行数:8,代码来源:volume.py


示例17: assigned_event

 def assigned_event(self, address, server_id):
     events.emit("update", {
         "id": address,
         "type": "floating_ip",
         "cloud": self.cloud.name,
         "data": {
             "server_id": server_id,
         }
     }, namespace="/events")
开发者ID:UshF,项目名称:pumphouse,代码行数:9,代码来源:floating_ip.py


示例18: created_event

 def created_event(self, image):
     LOG.info("Image created: %s", image["id"])
     events.emit("create", {
         "id": image["id"],
         "type": "image",
         "cloud": self.dst_cloud.name,
         "action": "uploading",
         "data": dict(image),
     }, namespace="/events")
开发者ID:UshF,项目名称:pumphouse,代码行数:9,代码来源:image.py


示例19: detach_event

 def detach_event(self, volume_id):
     LOG.info("Volume updated: %s", volume_id)
     events.emit("update", {
         "id": volume_id,
         "cloud": self.cloud.name,
         "type": "volume",
         "action": "detach",
         "data": dict(server_ids=[]),
     }, namespace="/events")
开发者ID:rmoe,项目名称:pumphouse,代码行数:9,代码来源:server.py


示例20: uploaded_event

 def uploaded_event(self, image):
     LOG.info("Image uploaded: %s", image["id"])
     events.emit("update", {
         "id": image["id"],
         "type": "image",
         "cloud": self.dst_cloud.name,
         "progress": None,
         "action": None,
         "data": dict(image),
     }, namespace="/events")
开发者ID:UshF,项目名称:pumphouse,代码行数:10,代码来源:image.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python pungi.spyOn函数代码示例发布时间:2022-05-25
下一篇:
Python pump.Pump类代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap