[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r28911 - in gnunet-planetlab/gplmt: contrib/tasklists gplmt
From: |
gnunet |
Subject: |
[GNUnet-SVN] r28911 - in gnunet-planetlab/gplmt: contrib/tasklists gplmt |
Date: |
Fri, 30 Aug 2013 10:49:20 +0200 |
Author: wachs
Date: 2013-08-30 10:49:20 +0200 (Fri, 30 Aug 2013)
New Revision: 28911
Modified:
gnunet-planetlab/gplmt/contrib/tasklists/check_fedora_version.xml
gnunet-planetlab/gplmt/gplmt/Notifications.py
Log:
renaming result collection for readability
FIX: result summary was interrupted if one node failed to connect: return ->
continue
Modified: gnunet-planetlab/gplmt/contrib/tasklists/check_fedora_version.xml
===================================================================
--- gnunet-planetlab/gplmt/contrib/tasklists/check_fedora_version.xml
2013-08-30 05:45:17 UTC (rev 28910)
+++ gnunet-planetlab/gplmt/contrib/tasklists/check_fedora_version.xml
2013-08-30 08:49:20 UTC (rev 28911)
@@ -12,7 +12,7 @@
</run>
- <run id="1" name="Check for Fedora 8 ">
+ <run id="1" name="Check for Fedora 8 " enabled="false">
<command>cat /etc/fedora-release</command>
<arguments></arguments>
<timeout>10</timeout>
@@ -22,7 +22,7 @@
</run>
<run id="2" name="Check for Fedora 12 ">
<command>cat /etc/fedora-release</command>
- <arguments>Fedora release 8 (Werewolf)</arguments>
+ <arguments></arguments>
<timeout>10</timeout>
<expected_return_code>0</expected_return_code>
<expected_output>Fedora release 12 (Constantine)</expected_output>
Modified: gnunet-planetlab/gplmt/gplmt/Notifications.py
===================================================================
--- gnunet-planetlab/gplmt/gplmt/Notifications.py 2013-08-30 05:45:17 UTC
(rev 28910)
+++ gnunet-planetlab/gplmt/gplmt/Notifications.py 2013-08-30 08:49:20 UTC
(rev 28911)
@@ -49,11 +49,13 @@
class NodeResultCollection:
def __init__(self):
- self.node_results = list ()
+ self.nodes_results = list ()
def add (self, node_res):
- self.node_results.append (node_res)
+ self.nodes_results.append (node_res)
+ def size (self):
+ return len(self.nodes_results)
def get (self, node):
- for n in self.node_results:
+ for n in self.nodes_results:
if (n.node == node):
return n
return None
@@ -101,7 +103,7 @@
def __init__(self, logger):
assert (None != logger)
self.logger = logger
- self.node_results = NodeResultCollection ()
+ self.nodes_results = NodeResultCollection ()
def node_connected (self, node, success, message):
return
def node_disconnected (self, node, success, message):
@@ -109,7 +111,7 @@
def tasklist_started (self, node, tasks, message):
return
def tasklist_completed (self, node, tasks, success, message):
- self.node_results.add (NodeResult(node))
+ self.nodes_results.add (NodeResult(node))
if (success == True):
print node + " : Tasklist '" + tasks.name + "' completed
successfully"
else:
@@ -124,12 +126,12 @@
def __init__(self, logger):
assert (None != logger)
self.logger = logger
- self.node_results = NodeResultCollection ()
+ self.nodes_results = NodeResultCollection ()
def summarize (self):
maxNodeLen = 0
maxTasklistLen = 0
# Calculate max length of node names and tasklist names
- for nres in self.node_results.node_results:
+ for nres in self.nodes_results.nodes_results:
nodeLen = len(nres.node.hostname)
if (nodeLen > maxNodeLen):
maxNodeLen = nodeLen
@@ -138,16 +140,17 @@
if(tlLen > maxTasklistLen):
maxTasklistLen = tlLen
# Sort output (success then fail)
- #self.node_results.node_results.sort(key=lambda x: not
x.tasklists.tasklists[0].success)
+ #self.nodes_results.nodes_results.sort(key=lambda x: not
x.tasklists.tasklists[0].success)
# Print organized output
- for nres in self.node_results.node_results:
+
+ for nres in self.nodes_results.nodes_results:
sys.stdout.write(nres.node.hostname)
diff = maxNodeLen - len(nres.node.hostname)
sys.stdout.write(' ' * diff + ' | ')
fail_in = ""
if (False == nres.connectSuccess):
print 'failed in: connecting: ' + nres.error_msg
- return
+ continue
for tl in nres.tasklists.tasklists:
sys.stdout.write(tl.name)
diff = maxTasklistLen - len(tl.name)
@@ -158,7 +161,6 @@
fail_in = fail_in + " " + t.task.name
print 'success' if (tl.success == Tasklist.Taskresult.success)
else 'failed in: ' +fail_in
for t in nres.tasks:
-
if (t.fail == True):
print "\tFailed Task: '" + t.task.name + "' with '"
+t.msg+ "' and '" + t.output.rstrip() + "'"
#else:
@@ -173,30 +175,31 @@
# tsk_str += t.task.name + " " + tsk_f + " ->"
# print nres.name
def node_connected (self, node, success, message):
+
# Get node object
- node_resObj = self.node_results.get(node)
+ node_result_object = self.nodes_results.get(node)
# Create it if it doesn't exist
- if(None == self.node_results.get(node)):
- node_resObj = NodeResult(node)
- self.node_results.add(node_resObj)
+ if(None == self.nodes_results.get(node)):
+ node_result_object = NodeResult(node)
+ self.nodes_results.add(node_result_object)
# Set node start time as of now
- node_resObj.start = time.time()
- node_resObj.connectSuccess = success
+ node_result_object.start = time.time()
+ node_result_object.connectSuccess = success
if (False == success):
- node_resObj.error_msg = message
+ node_result_object.error_msg = message
return
def node_disconnected (self, node, success, message):
# Mainly need to set node end connection time
- nodeObj = self.node_results.get(node)
+ nodeObj = self.nodes_results.get(node)
nodeObj.end = time.time()
return
def tasklist_started (self, node, tasks, message):
# Get node object
- nodeObj = self.node_results.get(node)
+ nodeObj = self.nodes_results.get(node)
# Create it if it doesn't exist (shouldn't node_connected be called
before this?)
- if(None == self.node_results.get(node)):
+ if(None == self.nodes_results.get(node)):
nodeObj = NodeResult(node)
- self.node_results.add(nodeObj)
+ self.nodes_results.add(nodeObj)
# Create tasklist object
tasklist = TaskList(tasks.name)
# Add it to the collection of node tasklists
@@ -204,7 +207,7 @@
return
def tasklist_completed (self, node, tasks, success, message):
# Mainly want to set tasklist end time and success status
- nodeObj = self.node_results.get(node)
+ nodeObj = self.nodes_results.get(node)
tasklist = nodeObj.tasklists.get(tasks.name)
tasklist.end = time.time()
tasklist.success = success
@@ -213,14 +216,14 @@
#else:
# print node + " : Tasklist '" + tasks.name + "' completed with
failure"
def task_started (self, node, task, message):
- nodeObj = self.node_results.get(node)
+ nodeObj = self.nodes_results.get(node)
if (None == nodeObj):
print "NodeResult not found!"
return
nodeObj.tasks.append (Task (task))
return
def task_completed (self, node, task, result, message, output):
- nodeObj = self.node_results.get(node)
+ nodeObj = self.nodes_results.get(node)
for t in nodeObj.tasks:
if t.task is task:
if (result != Tasklist.Taskresult.success):
@@ -235,9 +238,9 @@
def __init__(self, logger):
assert (None != logger)
self.logger = logger
- #self.node_results = NodeResultCollection ()
+ #self.nodes_results = NodeResultCollection ()
def summarize (self):
- #for n in self.node_results:
+ #for n in self.nodes_results:
# tsk_str = ""
# for t in n.tasks:
# tsk_f = "[e]"
@@ -260,7 +263,7 @@
print node.hostname + " : disconnected with failure"
def tasklist_started (self, node, tasks, message):
print node.hostname + " : Tasklist '" + tasks.name + "' started"
- #self.node_results.add (NodeResult(node))
+ #self.nodes_results.add (NodeResult(node))
def tasklist_completed (self, node, tasks, success, message):
if (success == Tasklist.Taskresult.success):
print node.hostname + " : Tasklist '" + tasks.name + "' completed
successfully"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r28911 - in gnunet-planetlab/gplmt: contrib/tasklists gplmt,
gnunet <=