X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=activity%2F__init__.py;h=4719a61cd800694bd3140aba21728e9608f5d67c;hb=c7309b368c2a6dcea1a231c9277b7e1fd118f266;hp=dfb7007cf1f2dd230a62811617e4f0f7fc155166;hpb=79ddc1c766e392e04f354a0e6329d7c50db0476f;p=unfold.git diff --git a/activity/__init__.py b/activity/__init__.py index dfb7007c..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: %s <%s> " % (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