Commit 6fd5eebe authored by Alain Takoudjou's avatar Alain Takoudjou

promise fix failures

parent 8db39d3b
......@@ -74,7 +74,7 @@ class RunPromise(GenericPromise):
timeout += 1
error_amount += 1
if error_amount:
self.logger.error("ERROR=%s (NOTROUTE=%s, UNREACHEABLENET=%s, TIMEOUT=%s)" % (
self.logger.error("ERROR=%s (NOROUTE=%s, UNREACHABLENET=%s, TIMEOUT=%s)" % (
error_amount, no_route_error, network_is_unreacheable, timeout))
else:
self.logger.info("OK")
......
......@@ -25,7 +25,7 @@ class RunPromise(GenericPromise):
raise ValueError("'address' was not set in promise parameters.")
# Force use ipv4 protocol ?
ipv4 = self.getConfig('ipv4') in ('True', 'true', '1')
count = self.getConfig('count', 10)
count = int(self.getConfig('count', 10))
threshold = int(self.getConfig('threshold', 0))
if threshold < 0:
raise ValueError("'threshold' value should be greater than 0.")
......
......@@ -22,7 +22,7 @@ class RunPromise(GenericPromise):
# promise ipv6 and ipv4 address to compare.
ipv4 = self.getConfig('ipv4')
ipv6 = self.getConfig('ipv6')
count = self.getConfig('count', 10)
count = int(self.getConfig('count', 10))
if not ipv4:
raise ValueError("'ipv4' was not set in promise parameters.")
if not ipv6:
......
......@@ -2,7 +2,10 @@ from zope import interface as zope_interface
from slapos.grid.promise import interface
from slapos.grid.promise.generic import GenericPromise
import subprocess
try:
import subprocess32 as subprocess
except ImportError:
import subprocess
class RunPromise(GenericPromise):
......@@ -10,7 +13,7 @@ class RunPromise(GenericPromise):
def __init__(self, config):
GenericPromise.__init__(self, config)
self.setPeriodicity(minute=5)
self.setPeriodicity(minute=int(self.getConfig('frequency', 5)))
def sense(self):
"""
......
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