Ignore:
Timestamp:
Nov 14, 2008 5:13:10 PM (15 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
Children:
afa43a8
Parents:
2dafa0c
Message:

Proxy key additions working

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/fedd_experiment_control.py

    r2dafa0c r4ed10ae  
    320320        except pickle.PicklingError, e:
    321321            self.log.error("Pickling problem: %s" % e)
     322        except TypeError, e:
     323            self.log.error("Pickling problem (TypeError): %s" % e)
    322324
    323325    # Call while holding self.state_lock
     
    441443            self.log.error("[start_segment]: can't open /dev/null: %s" %e)
    442444
    443         status = Popen(cmd, stdout=PIPE, stderr=dev_null)
    444         for line in status.stdout:
    445             m = state_re.match(line)
    446             if m: state = m.group(1)
    447             else:
    448                 m = no_exp_re.match(line)
    449                 if m: state = "none"
    450         rv = status.wait()
     445        if self.debug:
     446            state = 'swapped'
     447            rv = 0
     448        else:
     449            status = Popen(cmd, stdout=PIPE, stderr=dev_null)
     450            for line in status.stdout:
     451                m = state_re.match(line)
     452                if m: state = m.group(1)
     453                else:
     454                    m = no_exp_re.match(line)
     455                    if m: state = "none"
     456            rv = status.wait()
    451457
    452458        # If the experiment is not present the subcommand returns a non-zero
     
    766772        else: return None
    767773
    768 
    769774    def get_access(self, tb, nodes, user, tbparam):
    770775        """
     
    835840        except ZSI.ParseException, e:
    836841            raise service_error(service_error.req,
    837                     "Bad format message (XMLRPC??): %s" %
    838                     str(e))
    839         r = unpack_soap(resp)
     842                    "Bad format message (XMLRPC??): %s" % str(e))
     843        except ZSI.FaultException, e:
     844            resp = e.fault.detail[0]
     845
     846        # Again, weird incompatibilities rear their head.  userRoles, which are
     847        # restricted strings, seem to be encoded by ZSI as non-unicode strings
     848        # in a way that confuses the pickling and XMLRPC sending systems.
     849        # Explicitly unicoding them seems to fix this, though it concerns me
     850        # some.  It may be that these things are actually a ZSI string
     851        # subclass, and the character encoding is not the major issue.  In any
     852        # case, making all the subclasses of basestring into unicode strings
     853        # unifies the response format and solves the problem.
     854        r = make_unicode(unpack_soap(resp))
    840855
    841856        if r.has_key('RequestAccessResponseBody'):
     
    844859            raise service_error(service_error.proxy,
    845860                    "Bad proxy response")
    846 
    847861
    848862        e = r['emulab']
     
    868882                if key:
    869883                    tbparam[tb][key]= a['value']
    870 
     884       
    871885    def remote_splitter(self, uri, desc, master):
    872886
Note: See TracChangeset for help on using the changeset viewer.