Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab
authorYasin <mohammed-yasin.rahman@lip6.fr>
Fri, 10 Oct 2014 16:11:24 +0000 (18:11 +0200)
committerYasin <mohammed-yasin.rahman@lip6.fr>
Fri, 10 Oct 2014 16:11:24 +0000 (18:11 +0200)
activity/__init__.py

index d2a9e94..4719a61 100644 (file)
@@ -62,9 +62,10 @@ def logWrite(request, action, message, objects = None):
         "testbed"       : None,
     }
     
-    for o in objects :
-        if (o in log) :
-            log[o] = objects[o]
+    if objects is not None:
+        for o in objects :
+            if (o in log) :
+                log[o] = objects[o]
     
     try :
         result = urllib2.urlopen(server, urllib.urlencode(log))
@@ -72,7 +73,8 @@ def logWrite(request, action, message, objects = None):
         content = result.read()
     except urllib2.URLError as e:
         print "===============>> activity: connection to " + server + " impossible, could not log action"
-        print "==>> " + e.strerror
+        print e.strerror
+        print ""
 
 def log(request, action, message, objects = None):
     # Create a new thread in Daemon mode to send the log entry