summaryrefslogtreecommitdiffstats
path: root/gitautodeploy/parsers/common.py
diff options
context:
space:
mode:
authorOliver Poignant <oliver@poignant.se>2016-12-12 18:35:03 +0100
committerOliver Poignant <oliver@poignant.se>2016-12-12 18:35:03 +0100
commit8c406865ce388c1856f8dab495df4aa11f64f9cd (patch)
treed85ca148d33d9fd7e3fa37f564546e687a17c276 /gitautodeploy/parsers/common.py
parent30b8b34af911c3b3661f57366f0eeb56bfb5e3ed (diff)
downloadGit-Auto-Deploy-8c406865ce388c1856f8dab495df4aa11f64f9cd.zip
Git-Auto-Deploy-8c406865ce388c1856f8dab495df4aa11f64f9cd.tar.gz
Git-Auto-Deploy-8c406865ce388c1856f8dab495df4aa11f64f9cd.tar.bz2
Refactoring and preparations for JSON API
Diffstat (limited to 'gitautodeploy/parsers/common.py')
-rw-r--r--gitautodeploy/parsers/common.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/gitautodeploy/parsers/common.py b/gitautodeploy/parsers/common.py
index 1b40b73..b194062 100644
--- a/gitautodeploy/parsers/common.py
+++ b/gitautodeploy/parsers/common.py
@@ -6,7 +6,7 @@ class WebhookRequestParser(object):
def __init__(self, config):
self._config = config
- def get_matching_repo_configs(self, urls):
+ def get_matching_repo_configs(self, urls, action):
"""Iterates over the various repo URLs provided as argument (git://,
ssh:// and https:// for the repo) and compare them to any repo URL
specified in the config"""
@@ -21,7 +21,10 @@ class WebhookRequestParser(object):
elif 'url_without_usernme' in repo_config and repo_config['url_without_usernme'] == url:
configs.append(repo_config)
+ if len(configs) == 0:
+ action.log_warning('The URLs references in the webhook did not match any repository entry in the config. For this webhook to work, make sure you have at least one repository configured with one of the following URLs; %s' % ', '.join(urls))
+
return configs
- def validate_request(self, request_headers, repo_configs):
+ def validate_request(self, request_headers, repo_configs, action):
return True \ No newline at end of file