X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Fslicetabexperiment.py;h=138754a0da30c993b96f6d84579d49020425735c;hb=92620bf17c60377b7d156a6edf2c6a3077dd2745;hp=9eaaea70cc3b22e3b06a8f101fa827ac0b9c4cf0;hpb=8e18c9ff4a961c70f897ca3915959d2fa3f7fb38;p=myslice.git diff --git a/portal/slicetabexperiment.py b/portal/slicetabexperiment.py index 9eaaea70..138754a0 100644 --- a/portal/slicetabexperiment.py +++ b/portal/slicetabexperiment.py @@ -1,5 +1,3 @@ -from __future__ import print_function - # this somehow is not used anymore - should it not be ? from django.core.context_processors import csrf from django.http import HttpResponseRedirect @@ -18,6 +16,7 @@ from myslice.configengine import ConfigEngine from myslice.theme import ThemeView from myslice.configengine import ConfigEngine +from myslice.settings import logger from sfa.planetlab.plxrn import hash_loginbase @@ -45,12 +44,8 @@ class ExperimentView (FreeAccessView, ThemeView): try: for resources in current_resources: list_res = resources['resource'] - #print "list_b4" - #print list_res for res in list_res: split_list = res.split('+') # split the resource urn - #print "list_after" - #print split_list if [s for s in split_list if 'ple' in s]: # find ple resources res_hrn = split_list[-1] # last element is resource hrn ple_resource_list.append(res_hrn) @@ -68,17 +63,17 @@ class ExperimentView (FreeAccessView, ThemeView): nitos_resource_list.append(res_hrn) - except Exception,e: - print("Exception in slicetabexperiment.py in OneLab resource search %s" % e) + except Exception as e: + logger.error("Exception in slicetabexperiment.py in OneLab resource search {}".format(e)) - #print "list of ple res hrns" - #print ple_resource_list - #print "list of nit_paris res hrns" - #print nitos_paris_resource_list - #print "list of iotLab res hrns" - #print iotlab_resource_list - #print "list of nitos res hrns" - #print nitos_resource_list + #logger.debug("list of ple res hrns") + #logger.debug(ple_resource_list) + #logger.debug("list of nit_paris res hrns") + #logger.debug(nitos_paris_resource_list) + #logger.debug("list of iotLab res hrns") + #logger.debug(iotlab_resource_list) + #logger.debug("list of nitos res hrns") + #logger.debug(nitos_resource_list) all_users = list() #get all iotlab users @@ -94,7 +89,7 @@ class ExperimentView (FreeAccessView, ThemeView): res = urllib2.urlopen(req) all_users = json.load(res) except urllib2.URLError as e: - print("There is a problem in getting iotlab users %s" % e.reason) + logger.error("There is a problem in getting iotlab users {}".format(e.reason)) #getting the login from email