def is_stream_active(): containers = find_containers(curr_container_name) running = [] names_status = [] for c in containers: names_status.append({"name": c["Names"], "status": c["Status"]}) if c["Status"].startswith("Up"): running.append(c) return len(running) > 0
def stop_stream(): cli = get_docker_client() # Kill and remove existing containers. curr_containers = find_containers(curr_container_name, all=True) for c in curr_containers: i = c["Id"] if not c['Status'].startswith("Exited") and not c['Status'].startswith("Created"): logger.info("Killing container: '{0}'".format(c["Names"])) cli.kill(i) logger.info("Removing container: '{0}'".format(c["Names"])) cli.remove_container(i) options.curr_url = '' options.curr_quality = ''
def is_stream_active(): containers = find_containers(curr_container_name) running = [] names_status = [] for c in containers: names_status.append({ "name": c["Names"], "status": c["Status"] }) if c["Status"].startswith("Up"): running.append(c) return len(running) > 0
def stop_stream(): cli = get_docker_client() # Kill and remove existing containers. curr_containers = find_containers(curr_container_name, all=True) for c in curr_containers: i = c["Id"] if not c['Status'].startswith("Exited") and not c['Status'].startswith( "Created"): logger.info("Killing container: '{0}'".format(c["Names"])) cli.kill(i) logger.info("Removing container: '{0}'".format(c["Names"])) cli.remove_container(i) options.curr_url = '' options.curr_quality = ''