-c sfadebug on the command line to increment API_LOGLEVEL
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Wed, 8 Feb 2012 15:08:57 +0000 (16:08 +0100)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Wed, 8 Feb 2012 15:08:57 +0000 (16:08 +0100)
system/config_default.py
system/config_sfadebug.py [new file with mode: 0644]

index 98a0be7..288b613 100644 (file)
@@ -333,6 +333,7 @@ def plc (options,index) :
         'leases' : leases (options, index),
     }
 
+# NOTE: SFA currently has SFA_AGGREGATE_API_VERSION=2 baked into the code
 def sfa (options,index) :
     return { 
         # the default is to use AMs in the various aggregates.xml
@@ -347,8 +348,7 @@ def sfa (options,index) :
        'SFA_PLC_URL' : 'deferred-myplc-api-url',
         'SFA_PLC_USER' : 'root@test.onelab.eu',
         'SFA_PLC_PASSWORD' : 'test++',
-# use -c apiv2 to override this one
-#        'SFA_AGGREGATE_API_VERSION' : 1,
+# use -c sfadebug to increment this one
         'SFA_API_LOGLEVEL': 1,
         # details of the slices to create
         'sfa_slice_specs' : [ sfa_slice_spec(options,index,rspec_style) 
diff --git a/system/config_sfadebug.py b/system/config_sfadebug.py
new file mode 100644 (file)
index 0000000..c7b14c1
--- /dev/null
@@ -0,0 +1,12 @@
+# Thierry Parmentelat <thierry.parmentelat@inria.fr>
+# Copyright (C) 2012 INRIA 
+#
+# increment SFA_API_LOGLEVEL on all incoming plc_spec's
+
+def config (plc_specs, options):
+    def tweak_loglevel (plc_spec):
+        plc_spec['sfa']['SFA_API_LOGLEVEL'] += 1
+        return plc_spec
+    return [tweak_loglevel (plc_spec) for plc_spec in plc_specs ]
+
+