# Django settings for unfold project.
+ from __future__ import print_function
+
import os.path
import djcelery
building=True
DEBUG = True
- TEMPLATE_DEBUG = DEBUG
+
+ # show the various settings as we go
+ DEBUG_SETTINGS = False
# compute ROOT from where this file is installed
# should fit every need including developers
# when deployed from a package
# this code is run by collectstatic too, so we cannot
# assume we have ./static present already
-HTTPROOT="/var/myslice-f4f"
+HTTPROOT="/var/www/myslice/"
# the place to store local data, like e.g. the sqlite db
DATAROOT="/var/unfold"
+ if not os.path.isdir(DATAROOT):
+ print("WARNING: {} is a non-existing directory".format(DATAROOT))
+ print("consequently we assume development mode and re-route DATAROOT to {}".format(ROOT))
+ DATAROOT=ROOT
# if not there, then we assume it's from a devel tree
if not os.path.isdir (os.path.join(HTTPROOT,"static")):
HTTPROOT=ROOT
if not os.path.isdir(ROOT): raise Exception,"Cannot find ROOT %s for unfold"%ROOT
if not os.path.isdir(HTTPROOT): raise Exception,"Cannot find HTTPROOT %s for unfold"%HTTPROOT
+ if DEBUG_SETTINGS:
+ print('ROOT', ROOT)
+ print('DATAROOT', DATAROOT)
+ print('HTTPROOT', HTTPROOT)
+
# dec 2013 - we currently have 2 auxiliary subdirs with various utilities
# that we do not wish to package
# * sandbox is for plugin developers
}
}
+ if DEBUG_SETTINGS:
+ print('DATABASE NAME',DATABASES['default']['NAME'])
+
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
for aux in auxiliaries:
if os.path.isdir(os.path.join(ROOT,aux)):
- print "Using devel auxiliary",aux
+ print("Using devel auxiliary",aux)
INSTALLED_APPS.append(aux)
ACCOUNT_ACTIVATION_DAYS = 7 # One-week activation window; you may, of course, use a different value.
authorities_query = Query.get('authority').select('name', 'authority_hrn')
authorities = execute_admin_query(wsgi_request, authorities_query)
if authorities is not None:
+ authorities = sorted(authorities, key=lambda k: k['authority_hrn'])
authorities = sorted(authorities, key=lambda k: k['name'])
print "############ BREAKPOINT 1 #################"
'current_site' : current_site,
'email_hash' : email_hash,
'pi' : '',
- 'validation_link': current_site + '/portal/email_activation/'+ email_hash
+ 'validation_link': 'https://' + current_site + '/portal/email_activation/'+ email_hash
}
print "############ BREAKPOINT 4 #################"
# sqlite3 /var/unfold/unfold.sqlite3
# select email from auth_user;
if UserModel._default_manager.filter(email__iexact = user_request['email']):
- errors.append('<a href="/contact">Contact OneLab support</a> or try with another email.')
+ errors.append('<a href="/contact">Contact support</a> or try with another email.')
# XXX TODO: Factorize with portal/accountview.py
# XXX TODO: Factorize with portal/registrationview.py
from myslice.theme import ThemeView
from myslice.configengine import ConfigEngine
+ from sfa.planetlab.plxrn import hash_loginbase
+
import urllib2,json
class ExperimentView (FreeAccessView, ThemeView):
username = self.request.user
- split_slicename = slicename.split('.')
- ple_slicename = split_slicename[0] + '8' + split_slicename[1] + '_' + split_slicename[2]
-
- query_current_resources = Query.get('slice').select('resource').filter_by('slice_hrn','==',slicename)
+ query_current_resources = Query.get('slice').select('resource','parent_authority').filter_by('slice_hrn','==',slicename)
current_resources = execute_query(request, query_current_resources)
+ parent_authority = current_resources[0]['parent_authority']
+
+ split_slicename = slicename.split('.')
+ ple_slicename = hash_loginbase(parent_authority) + '_' + split_slicename[-1]
+
ple_resource_list=[]
nitos_resource_list=[]
nitos_paris_resource_list=[]
#print "list of nitos res hrns"
#print nitos_resource_list
+ all_users = list()
#get all iotlab users
try:
engine = ConfigEngine()
except urllib2.URLError as e:
print "There is a problem in getting iotlab users %s" % e.reason
- all_users = list()
#getting the login from email
#initial value no-account == contact_admin