From 5d5a27a2371f58d12b9231f29fd7f57b37f6899d Mon Sep 17 00:00:00 2001 From: Matt McEuen Date: Wed, 10 Jul 2019 14:45:21 -0500 Subject: [PATCH] Align git exception messages There were some inconsistencies around whether string parameter passed into Git exceptions is called repo_path or repo_url, causing the exception detail to occasionally not get rendered. This change standardizes on repo_url. Change-Id: Ibc78b33cc0e1fcd67820954b715f480a5b1f6496 --- pegleg/engine/exceptions.py | 4 ++-- pegleg/engine/util/git.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pegleg/engine/exceptions.py b/pegleg/engine/exceptions.py index 829491a5..4baf909e 100644 --- a/pegleg/engine/exceptions.py +++ b/pegleg/engine/exceptions.py @@ -59,12 +59,12 @@ class GitSSHException(PeglegBaseException): class GitConfigException(PeglegBaseException): """Exception that occurs when reading Git repo config fails.""" - message = 'Failed to read Git config file for repo path: %(repo_path)s' + message = 'Failed to read Git config file for repo path: %(repo_url)s' class GitInvalidRepoException(PeglegBaseException): """Exception raised when an invalid repository is detected.""" - message = 'The repository path or URL is invalid: %(repo_path)s' + message = 'The repository path or URL is invalid: %(repo_url)s' class GitMissingUserException(PeglegBaseException): diff --git a/pegleg/engine/util/git.py b/pegleg/engine/util/git.py index 1add77cb..c1d7f061 100644 --- a/pegleg/engine/util/git.py +++ b/pegleg/engine/util/git.py @@ -490,6 +490,6 @@ def normalize_repo_path(repo_url_or_path): orig_repo_url_or_path) LOG.error(msg) raise exceptions.GitInvalidRepoException( - repo_path=orig_repo_url_or_path) + repo_url=orig_repo_url_or_path) return repo_url_or_path, sub_path