本文整理汇总了Python中cloud.Compute.deregister_instance_dns方法的典型用法代码示例。如果您正苦于以下问题:Python Compute.deregister_instance_dns方法的具体用法?Python Compute.deregister_instance_dns怎么用?Python Compute.deregister_instance_dns使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cloud.Compute
的用法示例。
在下文中一共展示了Compute.deregister_instance_dns方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from cloud import Compute [as 别名]
# 或者: from cloud.Compute import deregister_instance_dns [as 别名]
def run(self):
Compute.deregister_instance_dns()
Compute.register_instance_dns()
JBoxd.publish_perf_counters()
JBoxd.log_debug("Setting up signal handlers")
signal.signal(signal.SIGINT, JBoxd.signal_handler)
signal.signal(signal.SIGTERM, JBoxd.signal_handler)
if VolMgr.has_update_for_user_home_image():
VolMgr.update_user_home_image(fetch=False)
while True:
self.log_debug("JBox daemon waiting for commands...")
try:
offline, reply_req = JBoxd.QUEUE.poll(self._is_scheduled(JBoxAsyncJob.CMD_REQ_RESP, ()))
except ValueError:
self.log_exception("Exception reading command. Will retry after 10 seconds")
time.sleep(10)
continue
if offline:
try:
self.process_offline()
except:
self.log_exception("Exception scheduling request")
if reply_req:
JBoxd.schedule_thread(JBoxAsyncJob.CMD_REQ_RESP, JBoxd.process_and_respond, ())
示例2: is_terminating
# 需要导入模块: from cloud import Compute [as 别名]
# 或者: from cloud.Compute import deregister_instance_dns [as 别名]
def is_terminating():
if not JBoxCfg.get('cloud_host.scale_down'):
return False
num_active = BaseContainer.num_active()
terminate = (num_active == 0) and Compute.can_terminate(is_proposed_cluster_leader())
if terminate:
JBoxd.log_warn("terminating to scale down")
try:
Compute.deregister_instance_dns()
except:
JBoxd.log_error("Error deregistering instance dns")
Compute.terminate_instance()
return terminate