make the comment about slice creation a bit more explicit
[myplc.git] / db-config
index f4d2c3d..dc984cb 100755 (executable)
--- a/db-config
+++ b/db-config
@@ -7,7 +7,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2006 The Trustees of Princeton University
 #
-# $Id$
+# $Id: db-config,v 1.11 2006/12/12 10:13:31 thierry Exp $
 #
 
 from plc_config import PLCConfiguration
@@ -360,7 +360,7 @@ def main():
          'postinstall_cmd': '/sbin/iptables-restore --noflush < /etc/planetlab/blacklist',
          'error_cmd': '',
          'ignore_cmd_errors': True,
-         'always_update': True},
+         'always_update': False},
 
         # /etc/issue
         {'enabled': True,
@@ -386,7 +386,7 @@ def main():
          'postinstall_cmd': '/sbin/sysctl -e -p /etc/sysctl.conf',
          'error_cmd': '',
          'ignore_cmd_errors': False,
-         'always_update': True},
+         'always_update': False},
 
         # Sendmail configuration
         {'enabled': True,
@@ -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,19 @@ def main():
                         ('proper_op', "bind_socket")]},
         ]
          
-
+    ### xxx - to review once new node manager rolls out
+    # if PLC_SLICE_PREFIX is left to default - this is meant for the public PL only
+    if plc['slice_prefix'] == 'pl':
+        # create both legacy slices together with netflow through 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: