SLA plugin: fixed template shown in dialog
[myslice.git] / myslice / components.py
index cfabb63..ea4d88c 100644 (file)
@@ -1,9 +1,11 @@
 from django.conf.urls import include, url
-from myslice.configengine import ConfigEngine
+from myslice.settings import config, logger
 
 def list():
-    config = ConfigEngine()
-    return config.myslice.components.split(',')
+    if config.myslice.components :
+        return config.myslice.components.split(',')
+    else :
+        return []
 
 def urls():
     u = []
@@ -12,9 +14,9 @@ def urls():
             __import__(component)
             u.append( url(r'^%s/' % component, include('%s.urls' % component)) )
         except Exception, e:
-            print "-> Cannot load component (%s): %s" % (component, e)
+            logger.error("Cannot load component ({}): {}".format(component, e))
         else:
-            print "-> Loaded component %s" % component
+            logger.info("Loaded component {}".format(component))
             
     return u