本文整理汇总了Python中marathon.MarathonClient.kill_tasks方法的典型用法代码示例。如果您正苦于以下问题:Python MarathonClient.kill_tasks方法的具体用法?Python MarathonClient.kill_tasks怎么用?Python MarathonClient.kill_tasks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类marathon.MarathonClient
的用法示例。
在下文中一共展示了MarathonClient.kill_tasks方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: open
# 需要导入模块: from marathon import MarathonClient [as 别名]
# 或者: from marathon.MarathonClient import kill_tasks [as 别名]
filter_inject = filter_read.read()
with open('%s/security/config.xml' % GEOSERVER_DATA_DIR) as config_read:
full_config = config_read.read()
if 'anonReload' in full_config:
logging.info('Configuration already supports anonymous REST reloads.')
# Only shim in anonymous reload and restart GeoServer if it hasn't been done before
else:
config_read.seek(0)
with open('%s/security/config.xml-output' % GEOSERVER_DATA_DIR, 'w') as config_write:
line_value = config_read.readline()
while len(line_value):
config_write.write('%s' % line_value)
if '<filterChain' in line_value:
config_write.write('%s' % filter_inject)
line_value = config_read.readline()
shutil.move('%s/security/config.xml-output' % GEOSERVER_DATA_DIR,
'%s/security/config.xml' % GEOSERVER_DATA_DIR)
response = MARATHON_CLIENT.kill_tasks(GEOSERVER_APP)
if not len(response) == 1:
logging.critical('Error restarting GeoServer')
sys.exit(1)
MARATHON_CLIENT.scale_app(GEOSERVER_APP, GEOSERVER_INSTANCES)
block_for_healthy_app(MARATHON_CLIENT, GEOSERVER_APP, GEOSERVER_INSTANCES)
logging.info('Bootstrap complete.')