Open waldner opened 11 months ago
The problem seems to be in the way that argparse.REMAINDER
is handled in python 3.11, I'm looking for more information.
No, in fact the problem is that the fix (https://github.com/vlaci/openconnect-sso/blame/master/openconnect_sso/cli.py#L125) is not in Pypi yet. So, released version 0.8.1 is broken because of this line:
setattr(namespace, self.dest, values[1:])
If you could check if the latest git master is working, I'll release it
I'll check it out as soon as I have a moment, thanks.
Yes master is working (note I only tested this specific thing).
@vlaci released?
No, in fact the problem is that the fix (https://github.com/vlaci/openconnect-sso/blame/master/openconnect_sso/cli.py#L125) is not in Pypi yet. So, released version 0.8.1 is broken because of this line:
setattr(namespace, self.dest, values[1:])
I confirm that by manually chaning setattr(namespace, self.dest, values[1:])
to setattr(namespace, self.dest, values)
fixes the problem. A temporary solution is to insert a dummy argument such as -V:
openconnect-sso --user joe@example.io --server example.io -- -V --script='vpn-slice example.io'
When using extra arguments to openconnect (ie those after
--
), depending on the syntax used an error might be produced, or the results might be unexpected.For example:
(note the missing
=
in the--script
argument, which is legal syntax) the followingopenconnect
invocation is produced:which openconnect rejects with
Too many arguments on command line
.On the other hand, if using the following syntax (also legal):
(ie with
--script=...
)The resulting
openconnect
invocation iswhich is valid openconnect syntax, but now the extra option is not passed at all, and indeed the custom script is not executed.