def rolling_restart(service_rr):
print service_rr
try:
#if service_rr.name.lower() in ['hive', 'hue', 'oozie', 'spark']:
# raise AttributeError("Rolling Restart is not available for '%s' " % service.name.lower())
batch_size = raw_input("Number of worker roles to restart together in a batch \n")
fail_count_threshold = raw_input("Stop rolling restart if more than this number of worker batches fail \n")
options = ["true", "false"] # options for stale config
stale_config_only = select_from_items('option to Restart roles on nodes with stale config?(Default is false) \n', options) # Needs to be a user selection
rr_command = service_rr.rolling_restart(batch_size, fail_count_threshold, None, stale_config_only, None, None, None).wait()
except:
print "WARNING: Rolling Restart is not available for '%s'. Exiting... " % service.name.lower()
print "Executing Restart on service '%s' " % service.name.lower()
rr_command = service.restart().wait()
return rr_command
# Get SMTP server and email sender/receiver info
cm_service_manager.py 文件源码
python
阅读 20
收藏 0
点赞 0
评论 0
评论列表
文章目录