-
Notifications
You must be signed in to change notification settings - Fork 31
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
Fix python cmdline parser for variants #180
Conversation
0e4b7c2
to
0327f71
Compare
Hmm the CI seems to be broken |
Given ``` type operation = Copy of string | Mirror of string ``` Represented as `["Copy", "arg"]` we need to parse that as JSON when given on the cmdline. Otherwise it'd do `operation[0]`, where `operation` is a string, which is not what we want. This doesn't affect usage from xapi-storage-script (which always calls it with --json), but it affects testing the python code by hand, because you can't supply the correct cmdline arguments (unless you construct an entire JSON by hand and pass it on stdin which is a bit tedious) Signed-off-by: Edwin Török <edwin.torok@cloud.com>
Looks like it is running 4.08.1 on macos, is it supposed to do that? |
I think we should probably update setup-ocaml to the latest version ocaml-rpc/.github/workflows/test.yml Line 32 in bdd3ab5
|
The previous issue was due to pylint complaining about the possibly uninitialised variable |
We've migrated XAPI and everything to Python3 recently, so I'm fine with dropping python2 support. |
Since we are not testing it in the CI anyway.
Given
Represented as
["Copy", "arg"]
we need to parse that as JSON when given on the cmdline.Otherwise it'd do
operation[0]
, whereoperation
is a string, which is not what we want.This doesn't affect usage from xapi-storage-script (which always calls it with --json),
but it affects testing the python code by hand, because you can't supply the correct cmdline arguments
(unless you construct an entire JSON by hand and pass it on stdin which is a bit tedious)