X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=activity%2F__init__.py;h=4719a61cd800694bd3140aba21728e9608f5d67c;hb=4d26ed18cf30c1e1dc12be165732486bc9510d84;hp=15b4e066d02adb77f213ce6dcb3764ce02cb0442;hpb=0be3cf98ec259d66a8c52163d433c869bb39a6b1;p=unfold.git diff --git a/activity/__init__.py b/activity/__init__.py index 15b4e066..4719a61c 100644 --- a/activity/__init__.py +++ b/activity/__init__.py @@ -62,17 +62,19 @@ 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)) - print "===============>> activity: " + action + " <" + request.user + "> " + message + print "===============>> activity: %s <%s> %s" % (action, request.user,message) 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