- print "*** WARNING: Skipping test %s: Node %s is not alive\n" % (
- name, node.get("hostname"))
+ print("*** WARNING: Skipping test %s: Node %s is not alive\n" % (
+ name, node.get("hostname")))
+ return
+
+ return func(*args, **kwargs)
+
+ return wrapped
+
+def skipIfAnyNotAliveWithIdentity(func):
+ name = func.__name__
+ def wrapped(*args, **kwargs):
+ argss = list(args)
+ argss.pop(0)
+ for i in xrange(len(argss)/3):
+ username = argss[i*3]
+ hostname = argss[i*3+1]
+ identity = argss[i*3+2]
+
+ node, ec = create_node(hostname, username, identity)
+
+ if not node.is_alive():
+ print("*** WARNING: Skipping test %s: Node %s is not alive\n" % (
+ name, node.get("hostname")))