canonical/jhack

add event context to crpc

PietroPasotti opened this issue · 0 comments

Right now crpc sets up a neutral event context, where it simulates a 'charm-rpc' event.
We should add the possibility to pass a custom env as per jhack fire.

At that point, crpc could in principle become an option for jhack fire.
Consider jhack fire foo/0 db-relation-broken --script /path/to/crpc_script.py

To be considered in that case: do we want to run the script before or after the event is simulated? or, if we pass --script, should we skip simulating the event in the first place?

Consider:

  • jhack fire foo/0 update-status --before=/path/to/crpc_script.py --after=/path/to/crpc_script2.py
  • jhack fire foo/0 _ --before=/path/to/crpc_script.py --after=/path/to/crpc_script2.py