generate_token.py should look in its own dir for the default key, not the CWD |
||
Issue descriptionWhat steps will reproduce the problem? From the top-level Chrome dir, run: tools/origin_trials/generate_token.py http://localhost:8000 MyFeature What is the expected output? It generates a token using tools/origin_trials/eftest.key as the private key. What do you see instead? IOError: [Errno 2] No such file or directory: 'eftest.key' It should be looking relative to __file__, not the CWD.
,
Aug 9 2016
I would expect "--key-file" to be relative to $CWD. If a developer is overriding the key file, it seems likely they would store the key file somewhere other than the tools/origin_trials directory (so the key is not included/deleted by source control operations in their chromium checkout). In that case, some common invocations could be: [From the top-level Chrome dir]: tools/origin_trials/generate_token.py --key-file ~/some/path/to/my-key http://localhost:8000 MyFeature tools/origin_trials/generate_token.py --key-file ../../some/path/to/my-key http://localhost:8000 MyFeature [From the dir storing the key]: <path to chromium dir>/tools/origin_trials/generate_token.py --key-file my-key http://localhost:8000 MyFeature In many of the examples above, the script would not find the custom key file.
,
Aug 10 2016
Sorry, I never meant that --key-file should be relative to __file__ (it should certainly be relative to $PWD). Just the default location (so that the script does not require you to be in tools/origin_trials to run without --key-file).
,
Aug 10 2016
,
Aug 10 2016
Re: #2, #3 -- that makes sense, and I completely agree. This change should only be for the default file location.
,
Aug 10 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/84e0cd2dcb47e334341c2846890e156b3a7ab4c6 commit 84e0cd2dcb47e334341c2846890e156b3a7ab4c6 Author: mgiuca <mgiuca@chromium.org> Date: Wed Aug 10 05:47:22 2016 origin_trials/generate_token.py: Look for default key in script dir. Only matters if you don't use --key-file. This allows the script to be run from anywhere, rather than needing to be cd'd to tools/origin_trials. BUG= 635803 Review-Url: https://codereview.chromium.org/2230673002 Cr-Commit-Position: refs/heads/master@{#410970} [modify] https://crrev.com/84e0cd2dcb47e334341c2846890e156b3a7ab4c6/tools/origin_trials/generate_token.py
,
Aug 10 2016
|
||
►
Sign in to add a comment |
||
Comment 1 by iclell...@chromium.org
, Aug 9 2016