Commit ce623b03 authored by Jonathan Michalon's avatar Jonathan Michalon

Support adding several checks at one

parent 348ffe53
from lib.subprocess_compat import TimeoutExpired, Popen, PIPE
import re
import lib.mails as mails
from collections import Iterable
class Host(object):
......@@ -14,8 +15,13 @@ class Host(object):
class Checks(list):
def add(self, check, dests, **options):
self += [check(d, **options) for d in dests]
def add(self, checks, dests, **options):
if not isinstance(checks, Iterable):
checks = [checks]
if not isinstance(dests, Iterable):
dests = [dests]
for check in checks:
self += [check(d, **options) for d in dests]
class Check(object):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment