Skip to content

Commit

Permalink
Code Review Repsonse PR 6863 ManageIQ#1
Browse files Browse the repository at this point in the history
- Used a more specific exception.
- Updated exceptions text to be more readable.
  • Loading branch information
jamesooden committed Mar 14, 2018
1 parent 180e7db commit 17660b6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/coverage_report_jenkins.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,9 @@ def gen_project_key(name, version):
# at the beginning.
match = re.search('^(?P<major>\d+)\.(?P<minor>\d+)', version)
if not match:
raise Exception(
'Invalid version string given. Expect #.#[... .#] received: {}'.format(version))
raise ValueError(
'Start of version string must match: "(\d+).(\d+)", e.g. 5.9 received: {}'.format(
version))

project_key = '{name}_{major}_{minor}_ruby_coverage'.format(
name=name,
Expand Down Expand Up @@ -502,7 +503,8 @@ def main(appliance, jenkins_url, jenkins_user, jenkins_token, job_name):


if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Upload coverage data from jenkins job to sonarqube')
parser = argparse.ArgumentParser(
description='Upload coverage data from jenkins job to sonarqube')
parser.add_argument('jenkins_url')
parser.add_argument('jenkins_job_name')
parser.add_argument('work_appliance_ip')
Expand All @@ -516,4 +518,3 @@ def main(appliance, jenkins_url, jenkins_user, jenkins_token, job_name):
args.jenkins_user,
args.jenkins_token,
args.jenkins_job_name))

0 comments on commit 17660b6

Please sign in to comment.