New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trigger tool #155
Comments
It is indeed an interesting feature. It can be done with the current code, although not as easily as the from subprocess import call
from fedora_messaging.config import conf
def run(message):
call(conf["consumer_config"]["command"], shell=True) And a configuration file that contains these lines (named for example # The module and function name
callback = "run_command:run"
[consumer_config]
command = "echo message received" The module must be importable, so you may need to set Would that let you do what you want to do? |
@abompard, I was thinking we could add a couple generally useful callbacks to a It's only tangentially related, but I wonder if we should also allow specifying a Python file instead of only a Python path so folks don't need to deal with packaging. |
Yeah I agree to both propositions. |
Runs a configurable command when a message is received. Fixes fedora-infra#155 Signed-off-by: Jeremy Cline <jcline@redhat.com>
Runs a configurable command when a message is received. Fixes fedora-infra#155 Signed-off-by: Jeremy Cline <jcline@redhat.com>
Runs a configurable command when a message is received. Fixes fedora-infra#155 Signed-off-by: Jeremy Cline <jcline@redhat.com>
fedmsg has a tool called 'fedmsg-trigger'. It lets you easily do a one command line type thing to run a command/script when a specific message comes accross the bus.
It would be cool if there was something like this for fedora-messaging too.
The text was updated successfully, but these errors were encountered: