replace set_keys with a more capable python script
ClosedPublic

Authored by adamwill on Oct 9 2015, 1:40 AM.

Details

Summary

This thing...does...more...stuff. Basically I was thinking
about how we can ease automated deployment of containerized
openQA in infra, and it seemed like it'd be good to have this.
It lets you use variant hostnames, set worker instances to use
HTTPS or not, flip a worker host around between different
servers (e.g. a staging and a production one), stuff like that.
It also doesn't require interaction, which is good for ansible
etc.

Test Plan

Check it actually works and the change to the doc
is correct.

Diff Detail

Repository
rOPENQA fedora_openqa
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
adamwill retitled this revision from to replace set_keys with a more capable python script.Oct 9 2015, 1:40 AM
adamwill updated this object.
adamwill edited the test plan for this revision. (Show Details)
adamwill added reviewers: garretraziel, jskladan.
adamwill updated this revision to Diff 1605.Oct 9 2015, 1:56 AM

fix KEY and SECRET metavars, add optionxform comment

adamwill updated this revision to Diff 1606.Oct 9 2015, 2:10 AM

bit better handling of 'localhost'

God, I kinda hate how this stuff is set up, trying to handle it
sensibly.

jskladan accepted this revision.Oct 9 2015, 11:48 AM

well, I guess, why not. Seems like using a sledgehammer to crack a nut though :)

docker/openqa_data/scripts/client-conf
69–72

pls rename sec[s] to section[s]

71

what happens if args.hostname is set to 'localhost' already? I guess that it just goes through the cycle twice, setting the same thing two times, but just making sure ;)

123–159

every time I see this, I just crave for more people using https://github.com/docopt/docopt *wink wink*

This revision is now accepted and ready to land.Oct 9 2015, 11:48 AM
adamwill added inline comments.Oct 13 2015, 2:10 AM
docker/openqa_data/scripts/client-conf
71

yeah, exactly, it'd just do it twice, which causes no harm. It seemed not worth trying to handle this more cleverly.

123–159

eh, everyone seems to have a favourite. New Bodhi CLI is using some thing called 'click'. I'm just sticking with argparse as it's in core and widely used and I know how to use it now...FWIW, I don't like that docopt approach at all, I think I'd find it much harder than just using argparse...for the record, this took me like an hour to write, it's not much of a sledgehammer. :P

jskladan added inline comments.Oct 13 2015, 7:03 AM
docker/openqa_data/scripts/client-conf
123–159

It took me 15 minutes to read (just the parse_args()), which is why I prefer docopt. But this is more of a "lets yell at each other over beers" stuff than a technical quality of the code thing :)

This revision was automatically updated to reflect the committed changes.