from os import environ
from bkmk_objects import parse_params, set_params
-robot_name, robot_params = parse_params(environ.get("BKMK_ROBOT", "requests"))
+robot_names, robot_params = parse_params(
+ environ.get("BKMK_ROBOT", "curl,requests,forking"))
def import_robot(robot_name):
return ns['robot']
-robot = import_robot(robot_name)
-set_params(robot, robot_params)
+for robot_name in robot_names.split(','):
+ try:
+ robot = import_robot(robot_name)
+ except ImportError:
+ pass
+ else:
+ set_params(robot, robot_params)
+ break
+else:
+ raise ValueError("No robot found, tried " + robot_names)