Code review comment for lp:~dpigott/lava-scheduler-tool/fix821400-add-token-file

Dave Pigott (dpigott) wrote :

> Instead of checking this manually you can use MutuallyExclusiveGroup from
> argparse. It makes --help document this and allows you to express the same
> limitation without client-side code. See:
> http://argparse.googlecode.com/svn/trunk/doc/other-methods.html#mutual-
> exclusion
>
> 56 + if parsed_host.password:
> 57 + raise LavaCommandError(
> 58 + "Token specified in url but --token-file also passed.");

Actually, when I came to look at this, it doesn't apply. One is a command line option, the other is a part of the url as broken up by url parse, so I can't make a mutual exclusion. Pity. It's a really nice feature.

« Back to merge proposal