# 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
"""
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
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: