split plc.d/ and db-config.d between myplc and plcapi modules as a first step
[plcapi.git] / db-config.d / 020-boot_states
diff --git a/db-config.d/020-boot_states b/db-config.d/020-boot_states
new file mode 100644 (file)
index 0000000..b7a8a5b
--- /dev/null
@@ -0,0 +1,23 @@
+# -*-python-*-
+# $Id: 012-slice_tags -1   $
+# $URL: svn+ssh://thierry@svn.planet-lab.org/svn/MyPLC/trunk/db-config.d/012-slice_tags $
+#################### slice tag types
+default_boot_states = [
+    'boot',
+    'failboot',
+    'safeboot',
+    'install',
+    'reinstall',
+    'disabled',
+]
+current_boot_states = GetBootStates()
+for state in default_boot_states:
+    if state not in current_boot_states:
+        AddBootState(state)
+
+# TODO: Delete old boot states. 
+if False:# NOTE: Only set to true if all federating peers have the new default boot states above.
+    for state in current_boot_states:
+        if state not in default_boot_states:
+            DeleteBootState(state)
+