示例#1
0
 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
示例#2
0
文件: sliver.py 项目: HalasNet/felix
 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
示例#3
0
                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
示例#4
0
文件: ch_api.py 项目: HalasNet/felix
             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: