Quick patch as the registry on PLE was returning
[sfa.git] / sfa / managers / aggregate_manager.py
index 7c4bacb..2864567 100644 (file)
@@ -63,6 +63,7 @@ class AggregateManager:
             'geni_single_allocation': 0, # Accept operations that act on as subset of slivers in a given state.
             'geni_allocate': 'geni_many',# Multiple slivers can exist and be incrementally added, including those which connect or overlap in some way.
             'geni_credential_types': cred_types,
+            'geni_handles_speaksfor': True,     # supports 'speaks for' credentials
         }
         version.update(version_generic)
         version.update(self.rspec_versions())
@@ -145,6 +146,15 @@ class AggregateManager:
     def Renew(self, api, xrns, creds, expiration_time, options):
         call_id = options.get('call_id')
         if Callids().already_handled(call_id): return True
+
+        # extend as long as possible
+        if options.get('geni_extend_alap'):
+            now = datetime.datetime.now()
+            requested = utcparse(expiration_time)
+            max = adjust_datetime(now, days=int(api.config.SFA_MAX_SLICE_RENEW))
+            if requested > max:
+                expiration_time = max
+
         return api.driver.renew(xrns, expiration_time, options)
 
     def PerformOperationalAction(self, api, xrns, creds, action, options={}):