user needs to specify 'pltags':'sync' in the options to Allocate to use standard...
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Thu, 4 Jun 2015 12:07:14 +0000 (14:07 +0200)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Thu, 4 Jun 2015 12:07:14 +0000 (14:07 +0200)
sfa/methods/Allocate.py
sfa/planetlab/plslices.py

index 5d0c8d2..c8cbb0a 100644 (file)
@@ -37,9 +37,9 @@ class Allocate(Method):
       (*) options['pltags'] == 'append'
           All incoming slice tags are added to corresponding slivers, 
           unless an exact match can be found in the PLC db
-      (*) options['pltags'] == 'match'
+      (*) options['pltags'] == 'sync'
           The historical mode, that attempts to leave the PLC db in a state
-          that matches the ones specified in incoming rspec.
+          in sync with the ones specified in incoming rspec.
 
     See also http://svn.planet-lab.org/wiki/SFASliceTags
 
index bacba0f..ffa6f16 100644 (file)
@@ -562,14 +562,16 @@ class PlSlices:
         in the 'pltags' option that can be either
         (*) 'ignore' (default) - do nothing
         (*) 'append' - only add incoming tags, that do not match an existing tag
-        (*) anything else - tries to do the plain wholesale thing, 
+        (*) 'sync' - tries to do the plain wholesale thing, 
             i.e. to leave the db in sync with incoming tags
         """
         if options is None: options={}
 
         # lookup 'pltags' in options to find out which mode is requested here
+        pltags = options.get('pltags', 'ignore') 
         # make sure the default is 'ignore' 
-        pltags = options.get('pltags', 'ignore') or 'ignore'
+        if pltags not in ('ignore', 'append', 'sync'):
+            pltags = 'ignore'
 
         if pltags == 'ignore':
             logger.info('verify_slice_tags in ignore mode - leaving slice tags as-is')