2019-01-07 11:16:16 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2019-01-28 18:15:54 +01:00
|
|
|
"""Console script to control the bot_z daemon"""
|
|
|
|
|
|
|
|
import errno
|
2019-02-07 12:02:42 +01:00
|
|
|
from getpass import getpass
|
2019-01-28 21:08:04 +01:00
|
|
|
import logging
|
2019-01-28 18:15:54 +01:00
|
|
|
import os
|
2019-01-28 21:08:04 +01:00
|
|
|
import sys
|
2019-01-28 18:15:54 +01:00
|
|
|
import typing as T
|
2019-01-07 11:16:16 +01:00
|
|
|
|
|
|
|
import click
|
2019-01-28 18:15:54 +01:00
|
|
|
import lockfile
|
|
|
|
|
2019-02-05 09:07:03 +01:00
|
|
|
from bot_z.zdaemon import daemon_process
|
|
|
|
from bot_z.utils import Fifo, PLifo, cmd_marshal
|
2019-01-28 18:15:54 +01:00
|
|
|
|
2019-01-28 21:08:04 +01:00
|
|
|
logger = logging.getLogger(__name__)
|
2019-02-05 09:07:03 +01:00
|
|
|
logger.setLevel(os.environ.get("BOTZ_LOGLEVEL", logging.INFO))
|
2019-01-28 21:08:04 +01:00
|
|
|
sh = logging.StreamHandler(stream=sys.stdout)
|
2019-02-05 15:10:45 +01:00
|
|
|
cli_filter = logging.Filter(__name__)
|
|
|
|
sh.addFilter(cli_filter)
|
2019-01-28 21:08:04 +01:00
|
|
|
sh.setFormatter(logging.Formatter("%(message)s"))
|
|
|
|
logger.addHandler(sh)
|
|
|
|
|
2019-01-28 18:15:54 +01:00
|
|
|
|
2019-02-05 09:07:03 +01:00
|
|
|
def _check_name(lifo_path: str, name: T.Optional[str]) -> str:
|
|
|
|
with PLifo(lifo_path) as lifo:
|
|
|
|
if name is None:
|
|
|
|
return lifo.last()
|
|
|
|
if name not in lifo:
|
|
|
|
logger.error("Daemon not present. Exiting.")
|
|
|
|
sys.exit(2)
|
|
|
|
return name
|
|
|
|
|
|
|
|
|
2019-01-28 18:15:54 +01:00
|
|
|
@click.group()
|
|
|
|
@click.option("-d", "--debug", is_flag=True, default=False, help="Enable debug mode.")
|
2019-02-05 15:11:31 +01:00
|
|
|
@click.option(
|
2019-02-07 12:02:42 +01:00
|
|
|
"--no-headless",
|
|
|
|
"headless",
|
|
|
|
is_flag=True,
|
|
|
|
default=True,
|
|
|
|
help="Start the clients in foreground.",
|
2019-02-05 15:11:31 +01:00
|
|
|
)
|
2019-01-28 21:08:04 +01:00
|
|
|
@click.option(
|
|
|
|
"-v",
|
|
|
|
"--verbose",
|
|
|
|
is_flag=True,
|
|
|
|
default=False,
|
|
|
|
help="More verbose output from this cli.",
|
|
|
|
)
|
2019-01-28 18:15:54 +01:00
|
|
|
@click.option(
|
|
|
|
"-f",
|
|
|
|
"--fifo",
|
2019-02-05 15:11:31 +01:00
|
|
|
type=click.STRING,
|
|
|
|
default="bot_z.cmd",
|
2019-01-28 18:15:54 +01:00
|
|
|
help="Path to the control fifo.",
|
|
|
|
)
|
|
|
|
@click.option(
|
|
|
|
"-w",
|
|
|
|
"--workdir",
|
|
|
|
type=click.Path(exists=True, readable=True, writable=True, resolve_path=True),
|
2019-02-05 15:11:31 +01:00
|
|
|
default="/tmp",
|
2019-01-28 18:15:54 +01:00
|
|
|
help="The working dir where to launch the daemon and where the lockfile is put.",
|
|
|
|
)
|
|
|
|
@click.pass_context
|
2019-01-28 21:08:04 +01:00
|
|
|
def cli(
|
2019-02-05 15:11:31 +01:00
|
|
|
ctx: click.Context,
|
|
|
|
debug: bool,
|
|
|
|
headless: bool,
|
|
|
|
verbose: bool,
|
|
|
|
fifo: str,
|
|
|
|
workdir: str,
|
2019-01-28 21:08:04 +01:00
|
|
|
) -> None:
|
2019-01-28 18:15:54 +01:00
|
|
|
"""
|
|
|
|
Group cli.
|
|
|
|
"""
|
2019-01-28 21:08:04 +01:00
|
|
|
if verbose:
|
|
|
|
logger.setLevel(logging.DEBUG)
|
2019-01-28 18:15:54 +01:00
|
|
|
ctx.ensure_object(dict)
|
|
|
|
ctx.obj["debug"] = debug
|
2019-02-05 15:11:31 +01:00
|
|
|
ctx.obj["headless"] = headless
|
2019-01-28 21:08:04 +01:00
|
|
|
ctx.obj["verbose"] = verbose
|
2019-02-05 15:11:31 +01:00
|
|
|
ctx.obj["fifo"] = os.path.join(workdir, fifo)
|
2019-01-28 18:15:54 +01:00
|
|
|
ctx.obj["workdir"] = workdir
|
2019-02-05 09:07:03 +01:00
|
|
|
ctx.obj["lifo"] = os.path.join(workdir, "botz_open_daemons.list")
|
2019-01-28 18:15:54 +01:00
|
|
|
|
|
|
|
|
2019-02-05 09:07:03 +01:00
|
|
|
@cli.command("start-daemon")
|
2019-01-28 18:15:54 +01:00
|
|
|
@click.option(
|
|
|
|
"-t", "--timeout", type=click.INT, default=20, help="Browser requests timeout."
|
|
|
|
)
|
|
|
|
@click.option(
|
|
|
|
"-m",
|
|
|
|
"--umask",
|
|
|
|
type=click.INT,
|
|
|
|
default=0o002,
|
|
|
|
help="The umask of the control fifo.",
|
|
|
|
)
|
|
|
|
@click.option(
|
|
|
|
"-p",
|
|
|
|
"--proxy",
|
|
|
|
type=click.STRING,
|
|
|
|
default=None,
|
|
|
|
help="An optional string for the proxy with the form 'address:port'.",
|
|
|
|
)
|
|
|
|
@click.option(
|
|
|
|
"--foreground",
|
|
|
|
is_flag=True,
|
|
|
|
default=False,
|
|
|
|
help="Keep the process in foreground (do not daemonize).",
|
|
|
|
)
|
|
|
|
@click.argument("baseuri", type=click.STRING)
|
|
|
|
@click.pass_context
|
2019-02-05 09:07:03 +01:00
|
|
|
def start_daemon_command(
|
2019-01-28 18:15:54 +01:00
|
|
|
ctx: click.Context,
|
|
|
|
baseuri: str,
|
|
|
|
umask: int,
|
|
|
|
timeout: int,
|
|
|
|
proxy: T.Optional[str] = None,
|
|
|
|
foreground: bool = False,
|
|
|
|
) -> None:
|
|
|
|
"""
|
|
|
|
Invokes daemon_process for the first time.
|
|
|
|
"""
|
2019-01-28 21:08:04 +01:00
|
|
|
lf = lockfile.FileLock(os.path.join(ctx.obj["workdir"], "bot_z"))
|
|
|
|
logger.debug("Daemon starting. Lockfile: %s", lf)
|
2019-01-28 18:15:54 +01:00
|
|
|
proxy_tuple = None
|
|
|
|
if proxy:
|
|
|
|
proxy_tuple = tuple(proxy.split(":"))
|
|
|
|
|
|
|
|
daemon_process(
|
|
|
|
fifo_path=ctx.obj["fifo"],
|
|
|
|
working_dir=ctx.obj["workdir"],
|
|
|
|
umask=umask,
|
|
|
|
pidfile=lf,
|
|
|
|
base_uri=baseuri,
|
|
|
|
timeout=timeout,
|
|
|
|
proxy=proxy_tuple,
|
2019-02-05 15:11:31 +01:00
|
|
|
headless=ctx.obj["headless"],
|
2019-01-28 18:15:54 +01:00
|
|
|
debug=ctx.obj["debug"],
|
|
|
|
foreground=foreground,
|
|
|
|
)
|
2019-02-05 15:11:31 +01:00
|
|
|
if not foreground:
|
|
|
|
logger.info("Daemon started.")
|
2019-01-28 18:15:54 +01:00
|
|
|
|
|
|
|
|
2019-02-05 09:07:03 +01:00
|
|
|
@cli.command("list")
|
2019-02-05 09:07:46 +01:00
|
|
|
@click.option(
|
|
|
|
"-s",
|
|
|
|
"--status",
|
|
|
|
is_flag=True,
|
|
|
|
default=False,
|
|
|
|
help="Show also the status of each client.",
|
|
|
|
)
|
2019-02-05 09:07:03 +01:00
|
|
|
@click.pass_context
|
|
|
|
def list_command(ctx: click.Context, status: bool) -> None:
|
|
|
|
"""
|
2019-02-17 19:20:08 +01:00
|
|
|
Lists the clients attached
|
2019-02-05 09:07:03 +01:00
|
|
|
"""
|
2019-02-05 09:07:46 +01:00
|
|
|
logger.debug('Invoked the "list" command.')
|
2019-02-05 09:07:03 +01:00
|
|
|
with PLifo(ctx.obj["lifo"]) as lifo:
|
|
|
|
if len(lifo) == 0:
|
|
|
|
logger.info("No clients.")
|
|
|
|
return
|
|
|
|
for client in lifo.all():
|
|
|
|
logger.info(client)
|
|
|
|
if status:
|
|
|
|
_status_command(ctx, client)
|
|
|
|
|
|
|
|
|
|
|
|
@cli.command("start")
|
|
|
|
@click.option(
|
|
|
|
"-n",
|
|
|
|
"--name",
|
|
|
|
type=click.STRING,
|
|
|
|
prompt="Give the instance a name",
|
|
|
|
help="The daemon instance name.",
|
|
|
|
)
|
|
|
|
@click.pass_context
|
|
|
|
def start_command(ctx: click.Context, name: str) -> None:
|
|
|
|
"""
|
2019-02-17 19:20:08 +01:00
|
|
|
Starts a client.
|
2019-02-05 09:07:03 +01:00
|
|
|
"""
|
|
|
|
logger.debug("Sending the start command down the pipe: %s", ctx.obj["fifo"])
|
|
|
|
with open(ctx.obj["fifo"], "w") as fifo:
|
|
|
|
fifo.write(cmd_marshal(name=name, cmd="start"))
|
|
|
|
logger.info("Start sent.")
|
|
|
|
|
|
|
|
|
2019-02-05 15:11:31 +01:00
|
|
|
@cli.command("stop-daemon")
|
|
|
|
@click.pass_context
|
|
|
|
def stop_daemon_command(ctx: click.Context) -> None:
|
|
|
|
"""
|
2019-02-17 19:20:08 +01:00
|
|
|
Stops all the clients and shuts down the daemon.
|
2019-02-05 15:11:31 +01:00
|
|
|
"""
|
|
|
|
logger.debug("Sending the stop-daemon command down the pipe: %s", ctx.obj["fifo"])
|
|
|
|
with open(ctx.obj["fifo"], "w") as fifo:
|
|
|
|
fifo.write(cmd_marshal(name="", cmd="stop-daemon"))
|
|
|
|
logger.info("Stop-daemon sent.")
|
|
|
|
|
|
|
|
|
2019-01-28 18:15:54 +01:00
|
|
|
@cli.command("stop")
|
2019-02-05 09:07:03 +01:00
|
|
|
@click.option("-n", "--name", default=None, help="The instance to interact with.")
|
2019-01-28 18:15:54 +01:00
|
|
|
@click.pass_context
|
2019-02-05 09:07:03 +01:00
|
|
|
def stop_command(ctx: click.Context, name: T.Optional[str]) -> None:
|
2019-01-28 18:15:54 +01:00
|
|
|
"""
|
2019-02-17 19:20:08 +01:00
|
|
|
Stops a client.
|
2019-01-28 18:15:54 +01:00
|
|
|
"""
|
2019-01-28 21:08:04 +01:00
|
|
|
logger.debug("Sending the stop command down the pipe: %s", ctx.obj["fifo"])
|
2019-02-05 09:07:03 +01:00
|
|
|
name = _check_name(ctx.obj["lifo"], name)
|
2019-03-05 14:47:40 +01:00
|
|
|
logger.info("Stopping instance: %s", name)
|
2019-01-28 18:15:54 +01:00
|
|
|
with open(ctx.obj["fifo"], "w") as fifo:
|
2019-02-05 09:07:03 +01:00
|
|
|
fifo.write(cmd_marshal(name=name, cmd="stop"))
|
2019-01-28 21:08:04 +01:00
|
|
|
logger.info("Stop sent.")
|
2019-01-28 18:15:54 +01:00
|
|
|
|
|
|
|
|
2019-02-07 12:02:42 +01:00
|
|
|
def prompt_for_creds(param: str, hidden: bool = False) -> str:
|
|
|
|
if hidden:
|
|
|
|
return getpass("Insert {}: ".format(param))
|
|
|
|
return input("Insert {}: ".format(param))
|
|
|
|
|
|
|
|
|
|
|
|
@cli.command("login")
|
|
|
|
@click.option("-n", "--name", default=None, help="The instance to interact with.")
|
|
|
|
@click.option(
|
|
|
|
"-c",
|
|
|
|
"--credfile",
|
|
|
|
default=None,
|
|
|
|
type=click.File(),
|
|
|
|
help="The file containing username and password, on one line each.",
|
|
|
|
)
|
|
|
|
@click.option("-u", "--username", default=None, help="The username to login with.")
|
|
|
|
@click.option(
|
|
|
|
"-p",
|
|
|
|
"--password",
|
|
|
|
default=None,
|
|
|
|
help="[USE ONLY WHEN DEBUGGING!] The password to login with. Use --credfile.",
|
|
|
|
)
|
|
|
|
@click.option(
|
|
|
|
"-f",
|
|
|
|
"--force",
|
|
|
|
is_flag=True,
|
|
|
|
default=False,
|
|
|
|
help="Force logout, bypass login check.",
|
|
|
|
)
|
|
|
|
@click.pass_context
|
|
|
|
def login_command(
|
|
|
|
ctx: click.Context,
|
|
|
|
name: T.Optional[str],
|
|
|
|
username: T.Optional[str],
|
|
|
|
password: T.Optional[str],
|
|
|
|
credfile: T.Optional[T.TextIO],
|
|
|
|
force: bool,
|
|
|
|
) -> None:
|
|
|
|
"""
|
2019-02-17 19:20:08 +01:00
|
|
|
Logs a client in using the provided credentials.
|
2019-02-07 12:02:42 +01:00
|
|
|
"""
|
|
|
|
no_userpass = username is None or password is None
|
|
|
|
if credfile is not None and no_userpass:
|
|
|
|
username = credfile.readline()
|
|
|
|
password = credfile.readline()
|
|
|
|
elif credfile is not None and not no_userpass:
|
|
|
|
logger.warning("Ignoring command line provided username and password.")
|
|
|
|
elif credfile is None and no_userpass:
|
|
|
|
logger.warning("Missing username or password and credfile.")
|
|
|
|
if username is None:
|
|
|
|
username = prompt_for_creds("username")
|
|
|
|
if password is None:
|
|
|
|
password = prompt_for_creds("password", hidden=True)
|
|
|
|
else:
|
|
|
|
logger.warning("Do not use command line provided password in production!")
|
|
|
|
|
|
|
|
logger.debug("Sending the login command down the pipe: %s", ctx.obj["fifo"])
|
|
|
|
name = _check_name(ctx.obj["lifo"], name)
|
2019-03-05 14:47:40 +01:00
|
|
|
logger.info('Logging in on instance "%s" with username "%s".', name, username)
|
2019-02-07 12:02:42 +01:00
|
|
|
with open(ctx.obj["fifo"], "w") as fifo:
|
|
|
|
fifo.write(
|
|
|
|
cmd_marshal(
|
|
|
|
name=name,
|
|
|
|
cmd="login",
|
|
|
|
username=username,
|
|
|
|
password=password,
|
|
|
|
force=force,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
logger.info("Login sent.")
|
|
|
|
|
|
|
|
|
|
|
|
@cli.command("logout")
|
|
|
|
@click.option("-n", "--name", default=None, help="The instance to interact with.")
|
|
|
|
@click.option(
|
|
|
|
"-f",
|
|
|
|
"--force",
|
|
|
|
is_flag=True,
|
|
|
|
default=False,
|
|
|
|
help="Force logout, bypass login check.",
|
|
|
|
)
|
|
|
|
@click.pass_context
|
|
|
|
def logout_command(ctx: click.Context, name: T.Optional[str], force: bool) -> None:
|
|
|
|
"""
|
2019-02-17 19:20:08 +01:00
|
|
|
Logs a logged in client out.
|
2019-02-07 12:02:42 +01:00
|
|
|
"""
|
|
|
|
logger.debug("Sending the logout command down the pipe: %s", ctx.obj["fifo"])
|
|
|
|
name = _check_name(ctx.obj["lifo"], name)
|
2019-03-05 14:47:40 +01:00
|
|
|
logger.info("Logging out on instance: %s", name)
|
2019-02-07 12:02:42 +01:00
|
|
|
with open(ctx.obj["fifo"], "w") as fifo:
|
|
|
|
fifo.write(cmd_marshal(name=name, cmd="logout", force=force))
|
|
|
|
logger.info("Logout sent.")
|
|
|
|
|
|
|
|
|
2019-02-18 12:20:55 +01:00
|
|
|
@cli.command("checkin")
|
|
|
|
@click.option("-n", "--name", default=None, help="The instance to interact with.")
|
|
|
|
@click.option(
|
|
|
|
"-f",
|
|
|
|
"--force",
|
|
|
|
is_flag=True,
|
|
|
|
default=False,
|
|
|
|
help="Force logout, bypass login check.",
|
|
|
|
)
|
|
|
|
@click.pass_context
|
|
|
|
def checkin_command(ctx: click.Context, name: T.Optional[str], force: bool) -> None:
|
|
|
|
"""
|
|
|
|
Checks in on a logged in client.
|
|
|
|
"""
|
|
|
|
logger.debug("Sending the check in command down the pipe: %s", ctx.obj["fifo"])
|
|
|
|
name = _check_name(ctx.obj["lifo"], name)
|
2019-03-05 14:47:40 +01:00
|
|
|
logger.info("Checking in on instance: %s", name)
|
2019-02-18 12:20:55 +01:00
|
|
|
with open(ctx.obj["fifo"], "w") as fifo:
|
|
|
|
fifo.write(cmd_marshal(name=name, cmd="checkin", force=force))
|
|
|
|
logger.info("Check in sent.")
|
|
|
|
|
|
|
|
|
|
|
|
@cli.command("checkout")
|
|
|
|
@click.option("-n", "--name", default=None, help="The instance to interact with.")
|
|
|
|
@click.option(
|
|
|
|
"-f",
|
|
|
|
"--force",
|
|
|
|
is_flag=True,
|
|
|
|
default=False,
|
|
|
|
help="Force logout, bypass login check.",
|
|
|
|
)
|
|
|
|
@click.pass_context
|
|
|
|
def checkout_command(ctx: click.Context, name: T.Optional[str], force: bool) -> None:
|
|
|
|
"""
|
|
|
|
Checks out on a logged in client and checked in client.
|
|
|
|
"""
|
|
|
|
logger.debug("Sending the check out command down the pipe: %s", ctx.obj["fifo"])
|
|
|
|
name = _check_name(ctx.obj["lifo"], name)
|
2019-03-05 14:47:40 +01:00
|
|
|
logger.info("Checking out on instance: %s", name)
|
2019-02-18 12:20:55 +01:00
|
|
|
with open(ctx.obj["fifo"], "w") as fifo:
|
|
|
|
fifo.write(cmd_marshal(name=name, cmd="checkout", force=force))
|
|
|
|
logger.info("Check out sent.")
|
|
|
|
|
|
|
|
|
2019-01-28 18:15:54 +01:00
|
|
|
@cli.command("reload")
|
2019-02-05 09:07:03 +01:00
|
|
|
@click.option("-n", "--name", default=None, help="The instance to interact with.")
|
2019-01-28 18:15:54 +01:00
|
|
|
@click.pass_context
|
2019-02-05 09:07:03 +01:00
|
|
|
def reload_command(ctx: click.Context, name: T.Optional[str]) -> None:
|
2019-01-28 18:15:54 +01:00
|
|
|
"""
|
2019-02-17 19:20:08 +01:00
|
|
|
Resets a client to a clean state (discards the session).
|
2019-01-28 18:15:54 +01:00
|
|
|
"""
|
2019-01-28 21:08:04 +01:00
|
|
|
logger.debug("Sending the reload command down the pipe: %s", ctx.obj["fifo"])
|
2019-02-05 09:07:03 +01:00
|
|
|
name = _check_name(ctx.obj["lifo"], name)
|
2019-01-28 18:15:54 +01:00
|
|
|
with open(ctx.obj["fifo"], "w") as fifo:
|
2019-02-05 09:07:03 +01:00
|
|
|
fifo.write(cmd_marshal(name=name, cmd="reload"))
|
2019-01-28 21:08:04 +01:00
|
|
|
logger.info("Reload sent.")
|
2019-01-28 18:15:54 +01:00
|
|
|
|
2019-01-07 11:16:16 +01:00
|
|
|
|
2019-01-28 18:15:54 +01:00
|
|
|
@cli.command("status")
|
2019-02-05 09:07:03 +01:00
|
|
|
@click.option("-n", "--name", default=None, help="The instance to interact with.")
|
2019-01-28 18:15:54 +01:00
|
|
|
@click.pass_context
|
2019-02-05 09:07:03 +01:00
|
|
|
def status_command(ctx: click.Context, name: T.Optional[str]) -> None:
|
2019-01-28 18:15:54 +01:00
|
|
|
"""
|
2019-02-17 19:20:08 +01:00
|
|
|
Displays basic info on the state of a client.
|
2019-01-28 18:15:54 +01:00
|
|
|
"""
|
2019-02-05 15:11:31 +01:00
|
|
|
try:
|
|
|
|
name = _check_name(ctx.obj["lifo"], name)
|
|
|
|
except IndexError:
|
|
|
|
if len(PLifo.All(ctx.obj["lifo"])) != 0:
|
|
|
|
raise
|
|
|
|
logger.warning("No clients registered.")
|
|
|
|
return
|
2019-02-05 09:07:03 +01:00
|
|
|
_status_command(ctx, name)
|
|
|
|
|
|
|
|
|
|
|
|
def _status_command(ctx: click.Context, name: str) -> None:
|
2019-01-28 18:15:54 +01:00
|
|
|
rfifo_path = os.path.join(ctx.obj["workdir"], "rfifo-{}".format(id(ctx)))
|
2019-01-28 21:08:04 +01:00
|
|
|
logger.debug("Awaiting response on fifo: %s", rfifo_path)
|
2019-01-28 18:15:54 +01:00
|
|
|
try:
|
|
|
|
os.mkfifo(rfifo_path)
|
2019-01-28 21:08:04 +01:00
|
|
|
logger.debug("Response fifo newly created.")
|
2019-01-28 18:15:54 +01:00
|
|
|
except OSError as err:
|
|
|
|
if err.errno != errno.EEXIST:
|
|
|
|
raise
|
2019-01-28 21:08:04 +01:00
|
|
|
logger.debug("Response fifo exists.")
|
2019-01-07 11:16:16 +01:00
|
|
|
|
2019-01-28 18:15:54 +01:00
|
|
|
with Fifo(ctx.obj["fifo"], "w") as fifo:
|
2019-02-05 09:07:03 +01:00
|
|
|
fifo.write(cmd_marshal(name=name, cmd="status", rfifo_path=rfifo_path))
|
2019-01-28 21:08:04 +01:00
|
|
|
logger.debug("Awaiting response...")
|
2019-01-28 18:15:54 +01:00
|
|
|
done = False
|
|
|
|
while not done:
|
|
|
|
try:
|
|
|
|
with open(rfifo_path, "r") as rfifo:
|
|
|
|
resp = rfifo.read()
|
|
|
|
done = True
|
|
|
|
except FileNotFoundError as e:
|
2019-01-28 21:08:04 +01:00
|
|
|
logger.warning("File not found: %s", e)
|
2019-01-28 18:15:54 +01:00
|
|
|
pass
|
2019-01-28 21:08:04 +01:00
|
|
|
logger.info(resp)
|
2019-01-29 10:22:04 +01:00
|
|
|
try:
|
|
|
|
os.remove(rfifo_path)
|
|
|
|
except OSError as e:
|
|
|
|
logger.warning("Failed removing response fifo %s: %s", rfifo_path, e)
|
|
|
|
pass
|
2019-01-07 11:16:16 +01:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2019-01-28 18:15:54 +01:00
|
|
|
cli()
|