def handle_noargs(self, **options):
        """
        Grants flowspaces for previously conflictive slices at Flowvisor.
        Used in conjunction **and after** the script with the same name
        at expedient.
        
        Flow:
            1. Expedient: manage.py standardize_flowvisor_slices stop
            2. Expedient: manage.py standardize_flowvisor_slices start
            3. Opt-in: manage.py standardize_flowvisor_slices
        """
        # If 'slice_ids_to_grant_fs' file exists, do the following.
        # Otherwise warn and skip.
        try:
            f = open("%s/slice_ids_to_grant_fs" % path,"r")
            ids = pickle.load(f)
            f.close()
            os.remove("%s/slice_ids_to_grant_fs" % path)
            user = User.objects.filter(username=settings.ROOT_USERNAME)[0]
            adminFS = AdminFlowSpace.objects.filter(user = user)
            profile = UserProfile.get_or_create_profile(user)
            fv = FVServerProxy.objects.all()[0]
            for iden in ids:
                assigned_priority = profile.max_priority_level - Priority.Strict_Priority_Offset - 1
                all_this_admin_opts = UserOpts.objects.filter(user=user,nice=True)
                for admin_opt in all_this_admin_opts:
                    if admin_opt.priority <= assigned_priority:
                        assigned_priority = admin_opt.priority - 1
                # Filter by slice "keywords" (name), same as in the previous steps
                selexp = filter_own_experiment(iden)
                flow_space = ExperimentFLowSpace.objects.filter(exp=selexp.id)
                if not flow_space:
                    print "No matched flowspaces for slice %s" % iden['id']
                    continue 
                #intersected_flowspace = multi_fs_intersect(flow_space,adminFS,FlowSpace)
                intersected_flowspace = get_used_fs(flow_space)
                fv_args,match_list = opt_fs_into_exp(intersected_flowspace,selexp,user,assigned_priority,True)
                #for i in range(len(fv_args)):
                #    for j in range(len(fv_args)):
                #        print fv_args[i] == fv_args[j]
                returned_ids = fv.proxy.api.changeFlowSpace(fv_args)
                for i in range(len(match_list)):
                    match_list[i].fv_id = returned_ids[i]
                    match_list[i].save()
                allopts = UserOpts.objects.filter(user = user).order_by('-priority')
         
                for opt in allopts:
                    this_opt_fses = opt.optsflowspace_set.all()
                    fs_project = opt.experiment.project_name or ""
                    fs_slice = opt.experiment.slice_name or ""
                    fs_description = ""
                    for fs in this_opt_fses:
                        if fs_description != "":
                            fs_description = fs_description + "\n%s" % fs
                        else:
                            fs_description = "%s" % fs
                print "Flowspace for slice %s was successfully granted" % iden['id']
                time.sleep(FLOWVISOR_SLEEP_TIME)
            self.stdout.write("\033[92m%s\033[0m\n" % "Successfully granted flowspaces at FlowVisor\n")
        except Exception as e:
            print e
            self.stdout.write("\033[93mCould not access file with slice IDs. Skipping...\033[0m\n")
dataset/ETHPy150Open fp7-ofelia/ocf/optin_manager/src/python/openflow/optin_manager/commands/management/commands/standardize_flowvisor_slices.py/Command.handle_noargs/original