Commit e9c5f928 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

Merge branch 'periodicity'

Conflicts:
	slapos/grid/slapgrid.py
	slapos/tests/slapgrid.py

Add periodicity and factored tests
parents d51c8373 13838976
......@@ -659,11 +659,12 @@ class Slapgrid(object):
if software_path:
# Get periodicity from periodicity file if not forced
periodicity = self.maximum_periodicity
if not self.force_periodicity:
periodicity_path = os.path.join(software_path,'periodicity')
if os.path.exists(periodicity_path):
try:
self.maximum_periodicity = int(open(periodicity_path).read())
periodicity = int(open(periodicity_path).read())
except ValueError:
os.remove(periodicity_path)
exception = traceback.format_exc()
......@@ -680,7 +681,7 @@ class Slapgrid(object):
try:
if int(timestamp) <= int(old_timestamp):
if int(time.time()) <= (
last_runtime + self.maximum_periodicity) :
last_runtime + periodicity) :
return
except ValueError:
os.remove(timestamp_path)
......
This diff is collapsed.
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