Skip to content

Commit 4f80036

Browse files
committed
ptl-tool: Fix token file name and variable names
* Renames .github.key to .github_token to make it identical to ceph-backport.sh script. This fix eliminates creating 2 files that stores the same thing. * Rename the variables with the github/redmine conventions. Signed-off-by: Jos Collin <[email protected]>
1 parent 1e2414e commit 4f80036

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/script/ptl-tool.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
#
2424
# Important files in your $HOME:
2525
#
26-
# ~/.redmine_key -- Your redmine API key from right side of: https://tracker.ceph.com/my/account
26+
# ~/.redmine_key -- Your redmine API access key from right side of: https://tracker.ceph.com/my/account
2727
#
28-
# ~/.github.key -- Your github API key: https://github.com/settings/tokens
28+
# ~/.github_token -- Your github Personal access token: https://github.com/settings/tokens
2929
#
3030
# Some important environment variables:
3131
#
3232
# - PTL_TOOL_GITHUB_USER (your github username)
33-
# - PTL_TOOL_GITHUB_API_KEY (your github api key, or what is stored in ~/.github.key)
33+
# - PTL_TOOL_GITHUB_TOKEN (your github Personal access token, or what is stored in ~/.github_token)
3434
# - PTL_TOOL_REDMINE_USER (your redmine username)
3535
# - PTL_TOOL_REDMINE_API_KEY (your redmine api key, or what is stored in ~/redmine_key)
3636
# - PTL_TOOL_USER (your desired username embedded in test branch names)
@@ -170,13 +170,13 @@
170170
CI_REMOTE_URL = os.getenv("PTL_TOOL_CI_REMOTE_URL", f"[email protected]:{BASE_PROJECT}/{CI_REPO}.git")
171171
GITDIR = os.getenv("PTL_TOOL_GITDIR", ".")
172172
GITHUB_USER = os.getenv("PTL_TOOL_GITHUB_USER", os.getenv("PTL_TOOL_USER", getuser()))
173-
GITHUB_API_KEY = None
173+
GITHUB_TOKEN = None
174174
try:
175-
with open(expanduser("~/.github.key")) as f:
176-
GITHUB_API_KEY = f.read().strip()
175+
with open(expanduser("~/.github_token")) as f:
176+
GITHUB_TOKEN = f.read().strip()
177177
except FileNotFoundError:
178178
pass
179-
GITHUB_API_KEY = os.getenv("PTL_TOOL_GITHUB_API_KEY", GITHUB_API_KEY)
179+
GITHUB_TOKEN = os.getenv("PTL_TOOL_GITHUB_TOKEN", GITHUB_TOKEN)
180180
INDICATIONS = [
181181
re.compile("(Reviewed-by: .+ <[\[email protected]]+>)", re.IGNORECASE),
182182
re.compile("(Acked-by: .+ <[\[email protected]]+>)", re.IGNORECASE),
@@ -230,7 +230,7 @@
230230
TRACKER_MATCH = re.compile("(.*https?://tracker.ceph.com/.*)")
231231

232232
def gitauth():
233-
return (GITHUB_USER, GITHUB_API_KEY)
233+
return (GITHUB_USER, GITHUB_TOKEN)
234234

235235
def get(session, url, params=None, paging=True):
236236
if params is None:

0 commit comments

Comments
 (0)