Merge lp:~dpigott/lava-scheduler-tool/fix821400-add-token-file into lp:lava-scheduler-tool
Proposed by
Dave Pigott
Status: | Needs review |
---|---|
Proposed branch: | lp:~dpigott/lava-scheduler-tool/fix821400-add-token-file |
Merge into: | lp:lava-scheduler-tool |
Diff against target: |
86 lines (+59/-3) 1 file modified
lava_scheduler_tool/commands.py (+59/-3) |
To merge this branch: | bzr merge lp:~dpigott/lava-scheduler-tool/fix821400-add-token-file |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Zygmunt Krynicki (community) | Needs Information | ||
Michael Hudson-Doyle (community) | Needs Fixing | ||
Review via email: mp+74197@code.launchpad.net |
Description of the change
Added code to support --token-file to the submit-job command. In the process realised that cancel-job requires the same functionality and that there is now code duplication between auth-add and submit-job. Will open that work as a separate bug.
To post a comment you must log in.
Unmerged revisions
- 9. By Dave Pigott
-
Added authentiction token file support to submit-job
We can probably remove that line
81 +# server = AuthenticatingS erverProxy( KeyringAuthBack end())
82 +# self.args.SERVER, auth_backend=
While this looks okay I think parsing the URL would be saner for bogus URLs. xmlrpc_ url(uri) : ' + uri '/RPC2/ '):
22 +def normalize_
23 + if '://' not in uri:
24 + uri = 'http://
25 + if not uri.endswith('/'):
26 + uri += '/'
27 + if not uri.endswith(
28 + uri += 'RPC2/'
29 + return uri
Instead of checking this manually you can use MutuallyExclusi veGroup 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.");