From b8e18a13ad81c49d6766908981183d0244217167 Mon Sep 17 00:00:00 2001 From: Sam Hague Date: Fri, 27 Jan 2017 17:01:07 -0500 Subject: [PATCH] distchanges fix for messages with () in them Change-Id: Ia35c24bf77d476adb7c4a60ef127d95464b18adf Signed-off-by: Sam Hague --- tools/distchanges/gerritquery.py | 3 +++ .../tests/resources/git.properties.paren | 22 +++++++++++++++++++ tools/distchanges/tests/test_changes.py | 8 ++++--- 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 tools/distchanges/tests/resources/git.properties.paren diff --git a/tools/distchanges/gerritquery.py b/tools/distchanges/gerritquery.py index 7ebecc5129..1165067813 100644 --- a/tools/distchanges/gerritquery.py +++ b/tools/distchanges/gerritquery.py @@ -259,6 +259,9 @@ class GerritQuery: """ lines = [] for line in changes.split("\n"): + if line.find('"type":"error","message"') != -1: + print("there was a query error") + continue if line.find('stats') == -1: lines.append(line) if self.verbose >= 2: diff --git a/tools/distchanges/tests/resources/git.properties.paren b/tools/distchanges/tests/resources/git.properties.paren new file mode 100644 index 0000000000..d2867f7ccd --- /dev/null +++ b/tools/distchanges/tests/resources/git.properties.paren @@ -0,0 +1,22 @@ +#Generated by Git-Commit-Id-Plugin +#Fri Jan 27 15:27:07 UTC 2017 +git.build.user.email= +git.build.host=centos7-java-builder-2c-8g-3294 +git.dirty=false +git.remote.origin.url=ssh\://jenkins-releng@git.opendaylight.org\:29418/netconf +git.closest.tag.name=release/boron-sr2 +git.commit.id.describe-short=8f8b49c +git.commit.user.email=tcere@cisco.com +git.commit.time=27.01.2017 @ 15\:06\:57 UTC +git.commit.message.full=Merge "Use yangtools ParserStreamUtils.findSchemaNodeByNameAndNamespace() method" +git.build.version=1.2.0-SNAPSHOT +git.commit.message.short=Merge "Use yangtools ParserStreamUtils.findSchemaNodeByNameAndNamespace() method" +git.commit.id.abbrev=8f8b49c +git.branch=origin/master +git.build.user.name= +git.closest.tag.commit.count=2160 +git.commit.id.describe=8f8b49c +git.commit.id=8f8b49c1f6a113e88672f935c9cb497944af39f8 +git.tags= +git.build.time=27.01.2017 @ 15\:27\:07 UTC +git.commit.user.name=Tomas Cere \ No newline at end of file diff --git a/tools/distchanges/tests/test_changes.py b/tools/distchanges/tests/test_changes.py index 76fc8b0130..7d373f197e 100644 --- a/tools/distchanges/tests/test_changes.py +++ b/tools/distchanges/tests/test_changes.py @@ -5,7 +5,9 @@ import unittest from changes import Changes REMOTE_URL = 'ssh://git.opendaylight.org:29418' -PROJECT_NAMES = ['genius', 'mdsal', 'netvirt', 'neutron', 'openflowjava', 'openflowplugin', 'ovsdb', 'yangtools'] +NETVIRT_PROJECTS = ["netvirt", "controller", "dlux", "dluxapps", "genius", "infrautils", "mdsal", "netconf", + "neutron", "odlparent", "openflowplugin", "ovsdb", "sfc", "yangtools"] +PROJECT_NAMES = NETVIRT_PROJECTS DISTRO_PATH = "/tmp/distribution-karaf" BRANCH = 'master' LIMIT = 10 @@ -19,12 +21,12 @@ class TestChanges(unittest.TestCase): @staticmethod def run_cmd(branch, distro_patch, limit, qlimit, project_names, remote_url): - changes = Changes(branch, distro_patch, limit, qlimit, project_names, remote_url) + changes = Changes(branch, distro_patch, limit, qlimit, project_names, remote_url, 3) projects = changes.run_cmd() changes.pretty_print_projects(projects) def test_run_cmd_single(self): - project_names = ['openflowplugin'] + project_names = ['netconf'] self.run_cmd(BRANCH, DISTRO_PATH, LIMIT, QLIMIT, project_names, REMOTE_URL) def test_run_cmd_multiple(self): -- 2.36.6