diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-09-25 14:05:23 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-09-25 14:05:23 -0400 |
commit | 7538d45a318c8a4c67bcea82fc5868e4c27f664e (patch) | |
tree | f0ce82b87656c5f99fd017af05f21ff457dd8c73 | |
parent | 1d86747777d81bd38e273f0a4affb1d5dfba1ac7 (diff) | |
download | korg-helpers-7538d45a318c8a4c67bcea82fc5868e4c27f664e.tar.gz |
Don't require -r for housekeeping
We don't need reposdir when we're running housekeeping tasks, so don't
require that argument.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rwxr-xr-x | git-patchwork-bot.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/git-patchwork-bot.py b/git-patchwork-bot.py index 9bf357c..085b0b2 100755 --- a/git-patchwork-bot.py +++ b/git-patchwork-bot.py @@ -1244,7 +1244,7 @@ def pwrun(repo, rsettings): def check_repos(): # First, we run all repositories for repo in CONFIG['repos']: - fullpath = os.path.join(cmdargs.reposdir, repo.lstrip('/')) + fullpath = os.path.join(cmdargs.reposdir.rstrip('/'), repo.lstrip('/')) if not os.path.isdir(fullpath): logger.info('Repository not found: %s', repo) continue @@ -1260,7 +1260,7 @@ if __name__ == '__main__': ) parser.add_argument('-c', '--cfgfile', required=True, help='Config file with repository and project data.') - parser.add_argument('-r', '--reposdir', required=True, + parser.add_argument('-r', '--reposdir', default=None, help='Directory with repositories to process') parser.add_argument('-l', '--logfile', default=None, help='Log file for messages during quiet operation') @@ -1330,4 +1330,7 @@ if __name__ == '__main__': for _pname in _sconfig['projects']: housekeeping(_pname) else: + if not cmdargs.reposdir: + logger.critical('-r is required for this mode') + sys.exit(1) check_repos() |