exluded iotlab details from view and put into default configengine
authorYasin <mohammed-yasin.rahman@lip6.fr>
Tue, 23 Dec 2014 17:17:06 +0000 (18:17 +0100)
committerYasin <mohammed-yasin.rahman@lip6.fr>
Tue, 23 Dec 2014 17:17:06 +0000 (18:17 +0100)
myslice/configengine.py
portal/actions.py

index 5ce5260..680ddbc 100644 (file)
@@ -35,6 +35,10 @@ class ConfigEngine(object):
     default_manifold_admin_password = 'demo'
     default_myslice_theme           = 'onelab'
 
+    #iotlab dev url
+    default_iotlab_url = "https://devgrenoble.senslab.info/rest/admin/users"
+    default_iotlab_admin_user = "auge"
+    default_iotlab_admin_password= "k,mfg1+Q"
 
     def __init__ (self):
         parser = RawConfigParser ()
index e378ca5..31e4bcb 100644 (file)
@@ -11,6 +11,8 @@ from django.template.loader     import render_to_string
 from django.core.mail           import EmailMultiAlternatives, send_mail
 
 from myslice.theme              import ThemeView
+from myslice.configengine       import ConfigEngine
+
 
 theme = ThemeView()
 
@@ -808,9 +810,9 @@ def iotlab_create_user (wsgi_request, request, namespace = None, as_admin=False)
     import time
     from requests.auth import HTTPBasicAuth
     
-    URL_REST = 'https://devgrenoble.senslab.info/rest/admin/users'
-    LOGIN_ADMIN = "auge"
-    PASSWORD_ADMIN = "k,mfg1+Q"
+    URL_REST = ConfigEngine.default_iotlab_url
+    LOGIN_ADMIN = ConfigEngine.default_iotlab_admin_user
+    PASSWORD_ADMIN = ConfigEngine.default_iotlab_admin_password
 
     auth = HTTPBasicAuth(LOGIN_ADMIN,PASSWORD_ADMIN)
     headers = {'content-type': 'application/json'}