Previous merge introduced unstable state where whole slapgrid-cp could raise if one instance is bad

parent f2b54b4a
......@@ -623,11 +623,12 @@ class Slapgrid(object):
# Process Computer Partitions
clean_run = True
for computer_partition in self.getComputerPartitionList():
try:
computer_partition_id = computer_partition.getId()
try:
software_url = computer_partition.getSoftwareRelease().getURI()
# XXX should test status as well. But getState() returns default value.
# XXX should test status as well. But getState() returns default
# value.
except NotFoundError:
# No Software Release information: skip.
continue
......@@ -666,7 +667,8 @@ class Slapgrid(object):
logger.error(exception)
# Check if timestamp from server is more recent than local one.
# If not: it's not worth processing this partition (nothing has changed).
# If not: it's not worth processing this partition (nothing has
# changed).
if computer_partition_id not in self.computer_partition_filter_list and \
(not self.develop) and os.path.exists(timestamp_path):
old_timestamp = open(timestamp_path).read()
......@@ -674,14 +676,14 @@ class Slapgrid(object):
if timestamp:
try:
if int(timestamp) <= int(old_timestamp):
if int(time.time()) <= (last_runtime + self.maximum_periodicity) :
if int(time.time()) <= (
last_runtime + self.maximum_periodicity) :
continue
except ValueError:
os.remove(timestamp_path)
exception = traceback.format_exc()
logger.error(exception)
try:
software_path = os.path.join(self.software_root,
getSoftwareUrlHash(software_url))
local_partition = Partition(
......
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