system-config/tools/irc_checks.py
Ian Wienand ccda6d08a1 Move meetbot config to eavesdrop01.opendev.org
This enables the new eavesdrop01.opendev.org server in all current
channels.  Puppet has been disabled on the old server and we will
manually stop supybot/meetbot and mirgrate logs before this applies.

Change-Id: I4a422bb9589c8a8761191313a656f8377e93422f
2021-06-10 09:02:23 +10:00

54 lines
1.6 KiB
Python

#! /usr/bin/env python
# Copyright 2016 SUSE Linux GmbH
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import sys
import yaml
def check_meetbot():
errors = False
config = yaml.load(
open('inventory/service/group_vars/eavesdrop.yaml', 'r'),
Loader=yaml.SafeLoader)
meetbot_channels = config['limnoria_oftc_channels']
# IRC has a limit of 120 channels that we unfortunately hit with
# gerritbot. If we try connect to more, it will not connect to
# all. Avoid this situation.
if len(meetbot_channels) > 120:
print("ERROR: bots can only handle 120 channels but found %s."
% len(meetbot_channels))
print("Sorry, we're at our limit and cannot add more for now.")
print("If you want to help set up another instance contact the "
"infra team in #opendev.\n")
errors = True
return errors
def main():
errors = check_meetbot()
if errors:
print("Found errors in channel configuration!")
else:
print("No errors found in channel configuration!")
return errors
if __name__ == "__main__":
sys.exit(main())