varlink / python

Python implementation of the Varlink protocol
https://varlink.org/python/
Apache License 2.0
43 stars 8 forks source link

cli: fix calling a method when the server is identified by its address #27

Closed bonzini closed 4 years ago

bonzini commented 4 years ago

Inner function new_client tries to write to its parameter and expects the outer function to read the modified value. This obviously does not work, so move the parsing code out of new_client.

There are no CLI unit tests, but the command that now works is included in README.md. Before:

$ python -m varlink.cli call unix:/tmp/test/org.example.more.Ping '{ "ping": "Ping"}'
{'error': 'org.varlink.service.InterfaceNotFound', 'parameters': {'interface': 'unix:/tmp/test/org.example.more'}}

After:

$ python -m varlink.cli call unix:/tmp/test/org.example.more.Ping '{ "ping": "Ping"}'
{
  "pong": "Ping"
}
haraldh commented 4 years ago

Many thanks! :smile: