X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=check_robot.py;h=0dcadb865eec22b34141f27c995ce918735e58a9;hb=55dc4436151692354f9080801ecaeb15ce6309ab;hp=89e25120fb9ea7f5da8688528db22f1e7b16f68c;hpb=3b2827039f3de108639705f7a1775def0c00344c;p=releng%2Fbuilder.git diff --git a/check_robot.py b/check_robot.py index 89e25120f..0dcadb865 100755 --- a/check_robot.py +++ b/check_robot.py @@ -7,13 +7,14 @@ # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html ############################################################################## -# Ensures that we are only ever using one robot system -# -# Due to the way the Jenkins OpenStack Cloud plugin works we can only limit -# max parallel robot systems by the VM. So having multiple VM types makes it -# very difficult for us to properly limit the amount of parallel robot runs. +"""Ensures that we are only ever using one robot system. + +Due to the way the Jenkins OpenStack Cloud plugin works we can only limit +max parallel robot systems by the VM. So having multiple VM types makes it +very difficult for us to properly limit the amount of parallel robot runs. +""" -__author__ = 'Thanh Ha' +__author__ = "Thanh Ha" import fnmatch @@ -29,9 +30,9 @@ def get_robot_systems(filename): """ robots = set() - with open(filename, 'r') as _file: + with open(filename, "r") as _file: for num, line in enumerate(_file, 1): - if re.search('centos7-robot', line): + if re.search("centos7-robot", line): robots.add(line.rsplit(maxsplit=1)[1]) return robots @@ -39,8 +40,8 @@ def get_robot_systems(filename): if __name__ == "__main__": robots = [] - for root, dirnames, filenames in os.walk('jjb'): - for filename in fnmatch.filter(filenames, '*.yaml'): + for root, dirnames, filenames in os.walk("jjb"): + for filename in fnmatch.filter(filenames, "*.yaml"): robots += get_robot_systems(os.path.join(root, filename)) if len(robots) > 1: