Changeset 74572ba


Ignore:
Timestamp:
Sep 13, 2011 9:46:42 AM (13 years ago)
Author:
Ted Faber <faber@…>
Branches:
compt_changes, info-ops, master
Children:
b5aa64a
Parents:
77d05a5
Message:

Fix collision where user is creating an experiment, an experiment with
that localname exists, and the user cannot overwrite it. (Error was an
uncaught access denied exception.) Not tested yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/experiment_control.py

    r77d05a5 r74572ba  
    11031103            # fall through and do the collision avoidance.
    11041104            old_expid = self.get_experiment_fedid(eid)
    1105             if old_expid and self.check_experiment_access(fid, old_expid):
    1106                 self.state_lock.acquire()
    1107                 status = self.state[eid].get('experimentStatus', None)
    1108                 if status and status == 'failed':
    1109                     # remove the old access attributes
    1110                     self.clear_experiment_authorization(eid,
    1111                             need_state_lock=False)
    1112                     overwrite = True
    1113                     del self.state[eid]
    1114                     del self.state[old_expid]
    1115                 self.state_lock.release()
     1105            if old_expid:
     1106                users_experiment = True
     1107                try:
     1108                    self.check_experiment_access(fid, old_expid)
     1109                except service_error, e:
     1110                    if e.code == service_error.access: users_experiment = False
     1111                    else: raise e
     1112                if users_experiment:
     1113                    self.state_lock.acquire()
     1114                    status = self.state[eid].get('experimentStatus', None)
     1115                    if status and status == 'failed':
     1116                        # remove the old access attributes
     1117                        self.clear_experiment_authorization(eid,
     1118                                need_state_lock=False)
     1119                        overwrite = True
     1120                        del self.state[eid]
     1121                        del self.state[old_expid]
     1122                    self.state_lock.release()
    11161123            self.state_lock.acquire()
    11171124            while (self.state.has_key(eid) and not overwrite):
Note: See TracChangeset for help on using the changeset viewer.