return clusterList
def get_rspec(api, creds, options, call_id):
- if not Callids().should_handle_call_id(call_id): return ""
+ if Callids().already_handled(call_id): return ""
global cloud
# get slice's hrn from options
xrn = options.get('geni_slice_urn', '')
def get_rspec(api, creds, options, call_id):
- if not Callids().should_handle_call_id(call_id): return ""
+ if Callids().already_handled(call_id): return ""
# get slice's hrn from options
xrn = options.get('geni_slice_urn', '')
hrn, type = urn_to_hrn(xrn)
# xxx Thierry : caching at the aggregate level sounds wrong...
caching=True
+#caching=False
def get_rspec(api, creds, options,call_id):
- if not Callids().should_handle_call_id(call_id): return ""
+ if Callids().already_handled(call_id): return ""
# get slice's hrn from options
xrn = options.get('geni_slice_urn', '')
(hrn, type) = urn_to_hrn(xrn)
return True
def get_rspec(api, creds, options,call_id):
- if not Callids().should_handle_call_id(call_id): return ""
+ if Callids().already_handled(call_id): return ""
# get slice's hrn from options
xrn = options.get('geni_slice_urn', '')
hrn, type = urn_to_hrn(xrn)
# Thierry : caching at the slicemgr level makes sense to some extent
caching=True
+#caching=False
def get_rspec(api, creds, options, call_id):
- if not Callids().should_handle_call_id(call_id):
+ if Callids().already_handled(call_id):
api.logger.info("%d received get_rspec with known call_id %s"%(api.interface,call_id))
return ""
# the only primitive
# return True if the callid is unknown, False otherwise
- def should_handle_call_id (self,call_id):
+ def already_handled (self,call_id):
# if not provided in the call...
- if not call_id: return True
+ if not call_id: return False
has_lock=False
for attempt in range(_call_ids_impl.retries):
if debug: sfa_logger().debug("Waiting for lock (%d)"%attempt)
# in the unlikely event where we can't get the lock
if not has_lock:
sfa_logger().warning("_call_ids_impl.should_handle_call_id: could not acquire lock")
- return True
+ return False
# we're good to go
if self.has_key(call_id):
self._purge()
self._lock.release()
- return False
+ return True
self[call_id]=time.time()
self._purge()
self._lock.release()
if debug: sfa_logger().debug("released lock")
- return True
+ return False
def _purge(self):
now=time.time()