Gitlab validation must allow unspecified endpoint

Gitlab config validator currently requires the gitlab endpoint to be specified, even though we support leaving it unspecified for non-enterprise installs. Fix the validator to allow this case.
This commit is contained in:
Joseph Schorr 2017-03-30 12:57:41 -04:00
parent b375f10da8
commit a6486b7823
2 changed files with 4 additions and 8 deletions

View file

@ -13,11 +13,9 @@ class GitLabTriggerValidator(BaseValidator):
raise ConfigValidationException('Missing GitLab client id and client secret')
endpoint = github_config.get('GITLAB_ENDPOINT')
if not endpoint:
raise ConfigValidationException('Missing GitLab Endpoint')
if endpoint.find('http://') != 0 and endpoint.find('https://') != 0:
raise ConfigValidationException('GitLab Endpoint must start with http:// or https://')
if endpoint:
if endpoint.find('http://') != 0 and endpoint.find('https://') != 0:
raise ConfigValidationException('GitLab Endpoint must start with http:// or https://')
if not github_config.get('CLIENT_ID'):
raise ConfigValidationException('Missing Client ID')