def terminate_that_framework(context): try: paasta_print("terminating framework %s" % context.scheduler.framework_id) mesos_tools.terminate_framework(context.scheduler.framework_id) except HTTPError as e: raise Exception(e.response.text)
def _clean_up_paasta_native_frameworks(context): clear_mesos_tools_cache() # context.etc_paasta signals that we actually have configured the mesos-cli.json; without this, we don't know where # to connect to clean up paasta native frameworks. if hasattr(context, 'etc_paasta'): for framework in mesos_tools.get_mesos_master().frameworks(active_only=True): if framework.name.startswith('paasta '): paasta_print("cleaning up framework %s" % framework.name) try: mesos_tools.terminate_framework(framework.id) except requests.exceptions.HTTPError as e: paasta_print("Got exception when terminating framework %s: %s" % (framework.id, e))
def _clean_up_paasta_native_frameworks(context): clear_mesos_tools_cache() # context.etc_paasta signals that we actually have configured the mesos-cli.json; without this, we don't know where # to connect to clean up paasta native frameworks. if hasattr(context, "etc_paasta"): for framework in a_sync.block( mesos_tools.get_mesos_master().frameworks, active_only=True): if framework.name.startswith( "paasta_native ") or framework.name == getattr( context, "framework_name", ""): print("cleaning up framework %s" % framework.name) try: mesos_tools.terminate_framework(framework.id) except requests.exceptions.HTTPError as e: print( f"Got exception when terminating framework {framework.id}: {e}" )
def terminate_that_framework(context): try: print "terminating framework %s" % context.scheduler.framework_id mesos_tools.terminate_framework(context.scheduler.framework_id) except Exception as e: raise Exception(e.response.text)