From 9a9be5d586f364e9def995bbb1c4335c8e4a22ca Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Thu, 4 Jun 2015 14:07:14 +0200 Subject: [PATCH] user needs to specify 'pltags':'sync' in the options to Allocate to use standard behaviour, insted of more confusing 'match' --- sfa/methods/Allocate.py | 4 ++-- sfa/planetlab/plslices.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sfa/methods/Allocate.py b/sfa/methods/Allocate.py index 5d0c8d20..c8cbb0af 100644 --- a/sfa/methods/Allocate.py +++ b/sfa/methods/Allocate.py @@ -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 diff --git a/sfa/planetlab/plslices.py b/sfa/planetlab/plslices.py index bacba0ff..ffa6f164 100644 --- a/sfa/planetlab/plslices.py +++ b/sfa/planetlab/plslices.py @@ -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') -- 2.43.0