本文整理汇总了Python中vol.VolMgr.has_update_for_user_home_image方法的典型用法代码示例。如果您正苦于以下问题:Python VolMgr.has_update_for_user_home_image方法的具体用法?Python VolMgr.has_update_for_user_home_image怎么用?Python VolMgr.has_update_for_user_home_image使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vol.VolMgr
的用法示例。
在下文中一共展示了VolMgr.has_update_for_user_home_image方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from vol import VolMgr [as 别名]
# 或者: from vol.VolMgr import has_update_for_user_home_image [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: run
# 需要导入模块: from vol import VolMgr [as 别名]
# 或者: from vol.VolMgr import has_update_for_user_home_image [as 别名]
def run(self):
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...")
cmd, data = self.queue.recv()
if cmd == JBoxAsyncJob.CMD_BACKUP_CLEANUP:
args = (data,)
fn = JBoxd.backup_and_cleanup
elif cmd == JBoxAsyncJob.CMD_LAUNCH_SESSION:
args = (data[0], data[1], data[2])
fn = JBoxd.launch_session
elif cmd == JBoxAsyncJob.CMD_AUTO_ACTIVATE:
args = ()
fn = JBoxd.auto_activate
elif cmd == JBoxAsyncJob.CMD_UPDATE_USER_HOME_IMAGE:
args = ()
fn = JBoxd.update_user_home_image
elif cmd == JBoxAsyncJob.CMD_REFRESH_DISKS:
args = ()
fn = JBoxd.refresh_disks
elif cmd == JBoxAsyncJob.CMD_COLLECT_STATS:
args = ()
fn = JBoxd.collect_stats
else:
self.log_error("Unknown command " + str(cmd))
continue
JBoxd.schedule_thread(cmd, fn, args)
示例3: do_update_user_home_image
# 需要导入模块: from vol import VolMgr [as 别名]
# 或者: from vol.VolMgr import has_update_for_user_home_image [as 别名]
def do_update_user_home_image():
if VolMgr.has_update_for_user_home_image():
if not VolMgr.update_user_home_image(fetch=False):
JBoxContainer.async_update_user_home_image()