Added an interface that allows a user to update relevant expired API keys via the command line interface.
Files: cli.py: register_set_pagure_token cli.py: register_set_distgit_token cli.py: set_pagure_token cli.py: set_distgit_token cli.py: _set_token cli.py: _check_token
Tests: test_cli.py: TestSetToken (class) test_cli.py: get_cli test_cli.py: test_token_input_mixed_lowercase_numerical test_cli.py: test_token_input_none test_cli.py: test_token_input_lowercase test_cli.py: test_token_input_too_short test_cli.py: test_token_input_too_long
Fixes #192 Jira: RHELCMP-58
Signed-off-by: James Kunstle jkunstle@redhat.com
rebased onto 7d9781c4287baa236843f50e57bec4862a3d3fd6
rebased onto 3e9fdca8eb2a4faee841ff597f846a9a9b44d83e
rebased onto 324d52115b75efefaebedd46af3133185c98c491
Could this pattern "^\s[A-Z0-9]{64}\s$" simplify your processing? or "^[A-Z0-9]{64}$" with .strip()
In most (maybe every) cases, when the config file is hardcoded, we could even get to the situation, that fedpkg-stage script is used. It has its own config name. You can use self.name (which contains fedpkg or fedpkg-stage) to distinguish the script.
fedpkg-stage
self.name
self.name instead of const string.
Will this write the whole (global+user) config to the user config? If yes, this would effectively do a lot of changes. I prefer to do just partial changes in the token section. But it needn't be much more complex. What about use ConfigParser for loading separate user config, update it and write?
We could also think about the detection of the expired token. Earlier I sent you a method on how we can verify the API functionality. If it fails, we can show a hint about the new methods to the user.
rebased onto cac91ae33718a5f14c0fa5ac68d437bdf8c80993
rebased onto 334e6404b058d1380ab4eead92e2acb4dcc7390a
I updated the code to reflect the optimizations that you suggested, apart from the final optimization concerning checking the api token. I think that I'll open another ticket later for this since it adds another layer of complexity to the function and will require writing a batch of Mock tests.
rebased onto 0536e12b56f2673f23c3765efa803f4e62cf5410
rebased onto ed129e99d3ac475c61c0b96d6a5e2ea95437e96b
rebased onto 95465caa6e3b559dd01e966300293843c473e9d6
rebased onto c1e0fe9a12e95661aa7d6c3ce5ff425acde2a2ad
rebased onto c5849556d3824a17b8696217364bf23b08ae84da
after_more seems to be useless here. Both commands could be moved to others on line 99.
after_more
rebased onto 8840b9f267bf9f1a79a45d6e034516d933e07bcf
rebased onto 0492474c7e612025eb493de836e20aa5a4a81e90
Made changes to the autocomplete script, included the names of the new functions on line 99 as requested.
rebased onto ced0e5abe4ff266a5f572e5411c5d18c3f76cc08
Checked and it looks good.
Commit 92400b5c fixes this pull-request
Pull-Request has been merged by onosek
Added an interface that allows a user to update relevant expired
API keys via the command line interface.
Files:
cli.py: register_set_pagure_token
cli.py: register_set_distgit_token
cli.py: set_pagure_token
cli.py: set_distgit_token
cli.py: _set_token
cli.py: _check_token
Tests:
test_cli.py: TestSetToken (class)
test_cli.py: get_cli
test_cli.py: test_token_input_mixed_lowercase_numerical
test_cli.py: test_token_input_none
test_cli.py: test_token_input_lowercase
test_cli.py: test_token_input_too_short
test_cli.py: test_token_input_too_long
Fixes #192
Jira: RHELCMP-58
Signed-off-by: James Kunstle jkunstle@redhat.com