From 39627e6acfddf5ae098792bf063db1d0a6168792 Mon Sep 17 00:00:00 2001 From: bb1950328 Date: Tue, 3 Aug 2021 20:04:57 +0200 Subject: [PATCH] fix GitHub token not used when not password arg is not present --- github_backup/github_backup.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/github_backup/github_backup.py b/github_backup/github_backup.py index 03f5a65..e01f06c 100755 --- a/github_backup/github_backup.py +++ b/github_backup/github_backup.py @@ -71,14 +71,13 @@ def main(): args.backupdir = args.backupdir.rstrip("/") # Make the connection to Github here. - config = {} + config = {'login_or_token': args.login_or_token} if args.password == False: # no password option given, continue unauthenticated # unauthenticated users can only use http git method args.type = 'http' elif args.password == None: # password option given, but no password value given - config = {'login_or_token': args.login_or_token} if os.path.isfile(CONFFILE): cfg = ConfigParser() cfg.read(CONFFILE) @@ -91,7 +90,6 @@ def main(): if password: config['password'] = password else: - config = {'login_or_token': args.login_or_token} config['password'] = args.password LOGGER.debug("Github config: %r", config)