git://git.onelab.eu
/
myslice.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d8ff47b
)
log testbed and facility
author
Ciro Scognamiglio
<ciro.scognamiglio@cslash.net>
Fri, 3 Oct 2014 14:45:50 +0000
(16:45 +0200)
committer
Ciro Scognamiglio
<ciro.scognamiglio@cslash.net>
Fri, 3 Oct 2014 14:45:50 +0000
(16:45 +0200)
activity/__init__.py
patch
|
blob
|
history
diff --git
a/activity/__init__.py
b/activity/__init__.py
index
6157bae
..
15b4e06
100644
(file)
--- a/
activity/__init__.py
+++ b/
activity/__init__.py
@@
-56,14
+56,15
@@
def logWrite(request, action, message, objects = None):
"apikey" : apikey,
"signature" : sign(secret, "%s%s%s%s" % (timestamp, ip, request.user, action)),
"slice" : None,
"apikey" : apikey,
"signature" : sign(secret, "%s%s%s%s" % (timestamp, ip, request.user, action)),
"slice" : None,
- "resource" : None
+ "resource" : None,
+ "resource_type" : None,
+ "facility" : None,
+ "testbed" : None,
}
}
- if objects and 'slice' in objects :
- log['slice'] = objects['slice']
-
- if objects and 'resource' in objects :
- log['resource'] = objects['resource']
+ for o in objects :
+ if (o in log) :
+ log[o] = objects[o]
try :
result = urllib2.urlopen(server, urllib.urlencode(log))
try :
result = urllib2.urlopen(server, urllib.urlencode(log))
@@
-71,6
+72,7
@@
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"
content = result.read()
except urllib2.URLError as e:
print "===============>> activity: connection to " + server + " impossible, could not log action"
+ print "==>> " + e.strerror
def log(request, action, message, objects = None):
# Create a new thread in Daemon mode to send the log entry
def log(request, action, message, objects = None):
# Create a new thread in Daemon mode to send the log entry