From f8106a21feafe0d4f3778095a95ff845615ec437 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 24 Jul 2014 09:07:38 -0400 Subject: [PATCH] add support for channel config being nested this adds support for the channel config being nested, and provides the basis for moving message catalog out of the code and into the yaml in a new nested section. Change-Id: I7353af4c3f141d4bd617d6fd388d7957e0586ba8 --- elastic_recheck/bot.py | 5 +++++ recheckwatchbot.yaml | 35 +++++++++++++++++------------------ 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/elastic_recheck/bot.py b/elastic_recheck/bot.py index aa3f290e..291b4f2b 100755 --- a/elastic_recheck/bot.py +++ b/elastic_recheck/bot.py @@ -217,6 +217,11 @@ class RecheckWatch(threading.Thread): class ChannelConfig(object): def __init__(self, data): self.data = data + # for compatibility reasons we support a pre channel hierarchy + # model of the world. + if 'channels' in data: + self.data = data['channels'] + keys = data.keys() for key in keys: if key[0] != '#': diff --git a/recheckwatchbot.yaml b/recheckwatchbot.yaml index 6474932a..9d8eae25 100644 --- a/recheckwatchbot.yaml +++ b/recheckwatchbot.yaml @@ -1,19 +1,18 @@ -openstack-nova: - projects: - - nova - events: - - positive - -openstack-glance: - projects: - - glance - events: - - positive - -openstack-qa: - projects: - - all - events: - - positive - - negative +channels: + openstack-nova: + projects: + - nova + events: + - positive + openstack-glance: + projects: + - glance + events: + - positive + openstack-qa: + projects: + - all + events: + - positive + - negative