forward CLI options to minions
ClosedPublic

Authored by kparal on Feb 12 2016, 2:57 PM.

Details

Summary

This fixes the issue where not all cmdline options were forwarded to the
minion.

This is a proof of concept, if you approve this, I'll add unit tests. I
have went back and forth between different implementation, and I've
found at least one serious roadblock or disadvantage for any of them.
Also all were ugly. This one implements a reverse argparser, but seems
the cleanest one, if you can believe that.

If you have suggestions how to implement this in a better way, I'm all
ears. (And I might also tell you that I tried it and didn't work out
because of X).

Test Plan

test suite is broken atm. I tested manually with a persistent client.

Diff Detail

Repository
rLTRN libtaskotron
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kparal retitled this revision from to forward CLI options to minions.Feb 12 2016, 2:57 PM
kparal updated this object.
kparal edited the test plan for this revision. (Show Details)
kparal added reviewers: tflink, mkrizek, jskladan, lbrabec.

Yes, this is awful, but since we have discussed it quite a lot, I do not have any objections :)

Macro neutralpresident: I don't have an opinion either way...

I'll second with an "ew" but as we discussed last week - it's not like I have a better idea and we need the functionality. I don't see anything that would block it from inclusion in libtaskotron.

kparal updated this revision to Diff 1919.Feb 16 2016, 1:09 PM
  • slightly tweaked and added a lot of unit tests
This revision is now accepted and ready to land.Feb 16 2016, 1:23 PM
mkrizek accepted this revision.Feb 16 2016, 1:41 PM

Looks good to me. I am not happy about it, though! :)

This revision was automatically updated to reflect the committed changes.

For future reference, one of the ideas was to pass whole sys.argv with slight tweaks (taskfile path change). We would append --minion to override --libvirt, --ssh and similar unwanted options. But the main problem here is that some options don't need to be present in sys.argv, and yet we need to pass their value, e.g. --uuid (uuid value must be the same on host and minion). So if the end, we would still need to parse sys.argv, handle both short and long options, recognize if certain options were added or not, and add them if needed. That would probably be even a bigger mess than reverse argparse.