git://git.onelab.eu
/
sfa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
An enhancement to sfa for tracing and logging calls. The original caller credential...
[sfa.git]
/
sfa
/
plc
/
slices.py
diff --git
a/sfa/plc/slices.py
b/sfa/plc/slices.py
index
a74687e
..
8931296
100644
(file)
--- a/
sfa/plc/slices.py
+++ b/
sfa/plc/slices.py
@@
-19,7
+19,7
@@
from sfa.server.registry import Registries
class Slices(SimpleStorage):
class Slices(SimpleStorage):
- def __init__(self, api, ttl = .5):
+ def __init__(self, api, ttl = .5
, caller_cred=None
):
self.api = api
self.ttl = ttl
self.threshold = None
self.api = api
self.ttl = ttl
self.threshold = None
@@
-30,6
+30,7
@@
class Slices(SimpleStorage):
SimpleStorage.__init__(self, self.slices_file)
self.policy = Policy(self.api)
self.load()
SimpleStorage.__init__(self, self.slices_file)
self.policy = Policy(self.api)
self.load()
+ self.caller_cred=caller_cred
def get_peer(self, hrn):
def get_peer(self, hrn):
@@
-138,7
+139,7
@@
class Slices(SimpleStorage):
aggregates = Aggregates(self.api)
for aggregate in aggregates:
try:
aggregates = Aggregates(self.api)
for aggregate in aggregates:
try:
- aggregates[aggregate].delete_slice(credential, hrn)
+ aggregates[aggregate].delete_slice(credential, hrn
, caller_cred=self.caller_cred
)
except:
print >> log, "Error calling list nodes at aggregate %s" % aggregate
traceback.print_exc(log)
except:
print >> log, "Error calling list nodes at aggregate %s" % aggregate
traceback.print_exc(log)
@@
-339,9
+340,9
@@
class Slices(SimpleStorage):
try:
# send the whloe rspec to the local aggregate
if aggregate in [self.api.hrn]:
try:
# send the whloe rspec to the local aggregate
if aggregate in [self.api.hrn]:
- aggregates[aggregate].create_slice(credential, hrn, rspec)
+ aggregates[aggregate].create_slice(credential, hrn, rspec
, caller_cred=self.caller_cred
)
else:
else:
- aggregates[aggregate].create_slice(credential, hrn, rspecs[aggregate])
+ aggregates[aggregate].create_slice(credential, hrn, rspecs[aggregate]
, caller_cred=self.caller_cred
)
except:
print >> log, "Error creating slice %(hrn)s at aggregate %(aggregate)s" % locals()
traceback.print_exc()
except:
print >> log, "Error creating slice %(hrn)s at aggregate %(aggregate)s" % locals()
traceback.print_exc()