From 6d79b6f68d7ab17fa65be6c92698cb51075e43e3 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Tue, 12 Dec 2006 10:13:31 +0000 Subject: [PATCH] support for changing SLICE_PREFIX first quick&dirty implementation: (*) if SLICE_PREFIX is the default 'pl' then the two legacy slices are created (*) otherwise they are not, and even deleted in case they were present this because the myplc doc instructs to perform a first run before configuring --- db-config | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/db-config b/db-config index 682962a..6aaa987 100755 --- a/db-config +++ b/db-config @@ -7,7 +7,7 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id$ +# $Id: db-config,v 1.10 2006/11/28 21:45:53 mlhuang Exp $ # from plc_config import PLCConfiguration @@ -587,7 +587,7 @@ def main(): plc_ticket_pubkey = '%KEY%' # Create/update system slices - default_slices = [ + legacy_slices = [ # XXX Required for old Node Manager {'name': "pl_conf", 'description': "PlanetLab Slice Creation Service (SCS)", @@ -609,7 +609,8 @@ def main(): 'attributes': [('cpu_share', "32"), ('plc_slice_type', "VServerSlice"), ('disk_max', "5000000")]}, - + ] + default_slices = [ # PlanetFlow {'name': plc['slice_prefix'] + "_netflow", 'description': "PlanetFlow Traffic Auditing Service", @@ -624,7 +625,18 @@ def main(): ('proper_op', "bind_socket")]}, ] - + ### leaving slice_prefix to default + if plc['slice_prefix'] == 'pl': + # create them with default slices + default_slices += legacy_slices + else: + # we use another slice prefix : disable legacy slices if already created + for legacy_slice in legacy_slices: + try: + DeleteSlice(legacy_slice['name']) + except: + pass + for default_slice in default_slices: slices = GetSlices([default_slice['name']]) if slices: -- 2.43.0