use node_id or hostname in get_node_hostname
[plcapi.git] / PLC / API.py
index 6ea37bc..dec2e08 100644 (file)
@@ -6,6 +6,7 @@
 #
 # Copyright (C) 2004-2006 The Trustees of Princeton University
 # $Id$
+# $URL$
 #
 
 import sys
@@ -125,10 +126,16 @@ class PLCAPI:
         if self.config.PLC_DB_TYPE == "postgresql":
             from PLC.PostgreSQL import PostgreSQL
             self.db = PostgreSQL(self)
-
         else:
             raise PLCAPIError, "Unsupported database type " + self.config.PLC_DB_TYPE
 
+        # Aspects modify the API injecting code before/after method
+        # calls. As of now we only have aspects for OMF integration,
+        # that's why we enable aspects only if PLC_OMF is set to true.
+        if self.config.PLC_OMF_ENABLED:
+            from aspects import apply_aspects; apply_aspects()
+
+
     def callable(self, method):
         """
         Return a new instance of the specified method.