/usr/lib/python2.7/dist-packages/cl/bin/cl.py is in python-cl 0.0.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | """cl.bin.cl"""
from __future__ import absolute_import
from kombu import Connection
from .base import Command, Option
from .. import Agent
from ..utils import instantiate
__all__ = ["cl", "main"]
class cl(Command):
option_list = (
Option("-i", "--id",
default=None, action="store", dest="id",
help="Id of the agent (or automatically generated)."),
Option("-l", "--loglevel",
default=None, action="store", dest="loglevel",
help="Loglevel (CRITICAL/ERROR/WARNING/INFO/DEBUG)."),
Option("-f", "--logfile",
default=None, action="store", dest="logfile",
help="Logfile. Default is stderr."),
Option("-H", "--hostname",
default=None, action="store", dest="hostname",
help="Broker hostname."),
Option("-P", "--port",
default=None, action="store", type="int", dest="port",
help="Broker port."),
Option("-u", "--userid",
default=None, action="store", dest="userid",
help="Broker user id."),
Option("-p", "--password",
default=None, action="store", dest="password",
help="Broker password."),
Option("-v", "--virtual-host",
default=None, action="store", dest="virtual_host",
help="Broker virtual host"),
Option("-T", "--transport",
default=None, action="store", dest="transport",
help="Broker transport"),
)
def run(self, *actors, **kwargs):
id = kwargs.get("id")
loglevel = kwargs.get("loglevel")
actors = [instantiate(actor) for actor in list(actors)]
connection = Connection(hostname=kwargs.get("hostname"),
port=kwargs.get("port"),
userid=kwargs.get("userid"),
password=kwargs.get("password"),
virtual_host=kwargs.get("virtual_host"),
transport=kwargs.get("transport"))
agent = Agent(connection, actors=actors, id=kwargs.get("id"))
agent.run_from_commandline(loglevel=kwargs.get("loglevel"),
logfile=kwargs.get("logfile"))
def main(argv=None):
return cl().execute_from_commandline(argv)
if __name__ == "__main__":
main()
|