def opt_in(urn): expiring_fs = ExpiringFlowSpaces.objects.filter(slice_urn=urn)[0] if expiring_fs.was_granted: exp = Experiment.objects.filter(slice_urn=urn)[0] auto_fs_granter(exp) return 1 else: pass #Let's see if is convenient to send an email
def opt_in(urn): expiring_fs = ExpiringFlowSpaces.objects.filter(slice_urn = urn)[0] if expiring_fs.was_granted: exp = Experiment.objects.filter(slice_urn = urn)[0] auto_fs_granter(exp) return 1 else: pass #Let's see if is convenient to send an email
for opt in all_opts: optfses = OptsFlowSpace.objects.filter(opt=opt) opt_fses_outof_exp(optfses) all_opts.delete() print exc raise Exception( parseFVexception( exc, "Couldn't re-opt into updated experiment. Lost all the opt-ins: " )) flowspace_correctly_granted = True automatic_settings = get_automatic_settings() try: if automatic_settings["flowspace_auto_approval"]: auto_fs_granter(e) # FIXME An exception is being raised. Investigate. except Exception as exc: print "Exception happened when granting flowspace automatically: %s" % str( exc) flowspace_correctly_granted = False try: # Get project detail URL to send via e-mail from openflow.optin_manager.opts import urls from django.core.urlresolvers import reverse project_detail_url = reverse("opt_in_experiment") or "/" # No "https://" check should be needed if settings are OK site_domain_url = "https://" + Site.objects.get_current( ).domain + project_detail_url # Tuple with the requested VLAN range
from openflow.optin_manager.opts.helper import opt_fses_outof_exp import traceback traceback.print_exc() all_opts = UserOpts.objects.filter(experiment=e) for opt in all_opts: optfses = OptsFlowSpace.objects.filter(opt = opt) opt_fses_outof_exp(optfses) all_opts.delete() print exc raise Exception(parseFVexception(exc,"Couldn't re-opt into updated experiment. Lost all the opt-ins: ")) flowspace_correctly_granted = True automatic_settings = get_automatic_settings() try: if automatic_settings["flowspace_auto_approval"]: auto_fs_granter(e) # FIXME An exception is being raised. Investigate. except Exception as exc: print "Exception happened when granting flowspace automatically: %s" % str(exc) flowspace_correctly_granted = False try: # Get project detail URL to send via e-mail from openflow.optin_manager.opts import urls from django.core.urlresolvers import reverse project_detail_url = reverse("opt_in_experiment") or "/" # No "https://" check should be needed if settings are OK site_domain_url = "https://" + Site.objects.get_current().domain + project_detail_url # Tuple with the requested VLAN range vlan_range = "" try: