Ignore:
Timestamp:
Nov 28, 2011 7:34:11 PM (12 years ago)
Author:
Ted Faber <faber@…>
Branches:
compt_changes, info-ops, master
Children:
ec3aa4d
Parents:
45e880d
Message:

InfoSegment? to emulab access controllers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/emulab_access.py

    r45e880d r6e33086  
    101101            self.start_segment = proxy_emulab_segment.start_segment
    102102            self.stop_segment = proxy_emulab_segment.stop_segment
     103            self.info_segment = proxy_emulab_segment.info_segment
    103104        elif self.access_type == 'local_emulab':
    104105            self.start_segment = local_emulab_segment.start_segment
    105106            self.stop_segment = local_emulab_segment.stop_segment
     107            self.info_segment = local_emulab_segment.info_segment
    106108        else:
    107109            self.start_segment = None
    108110            self.stop_segment = None
     111            self.info_segment = None
    109112
    110113        self.restricted = [ ]
     
    181184            'TerminateSegment': soap_handler("TerminateSegment",
    182185                self.TerminateSegment),
     186            'InfoSegment': soap_handler("InfoSegment", self.InfoSegment),
    183187            }
    184188        self.xmlrpc_services =  {\
     
    190194            'TerminateSegment': xmlrpc_handler('TerminateSegment',
    191195                self.TerminateSegment),
     196            'InfoSegment': xmlrpc_handler("InfoSegment", self.InfoSegment),
    192197            }
    193198
     
    10111016        return (ename, proj, user, pubkey_base, secretkey_base, alloc_log)
    10121017
    1013     def finalize_experiment(self, starter, topo, aid, alloc_id, proof):
    1014         """
    1015         Store key bits of experiment state in the global repository, including
    1016         the response that may need to be replayed, and return the response.
    1017         """
    1018         i = 0
    1019         t = topo.clone()
     1018    def decorate_topology(self, info, t):
     1019        """
     1020        Copy the physical mapping and status onto the topology.  Used by
     1021        StartSegment and InfoSegment
     1022        """
     1023        def add_new(ann, attr):
     1024            for a in ann:
     1025                if a not in attr: attr.append(a)
     1026
    10201027        # Copy the assigned names into the return topology
    10211028        for e in t.elements:
    10221029            if isinstance(e, topdl.Computer):
    10231030                if not self.create_debug:
    1024                     if e.name in starter.node:
    1025                         e.localname.append("%s%s" % \
    1026                                 (starter.node[e.name][0], self.domain))
    1027                         e.status = starter.node[e.name][1]
     1031                    if e.name in info.node:
     1032                        add_new(("%s%s" % (info.node[e.name][0], self.domain),),
     1033                                e.localname)
     1034                        e.status = info.node[e.name][1]
    10281035                else:
    10291036                    # Simple debugging assignment
    1030                     e.localname.append("node%d%s" % (i, self.domain))
     1037                    add_new(("node%d%s" % (i, self.domain),), e.localname)
    10311038                    e.status = 'active'
    1032                     e.operation.extend(('testop1', 'testop2'))
     1039                    add_new(('testop1', 'testop2'), e.operation)
    10331040                    i += 1
    10341041
     1042
     1043    def finalize_experiment(self, starter, topo, aid, alloc_id, proof):
     1044        """
     1045        Store key bits of experiment state in the global repository, including
     1046        the response that may need to be replayed, and return the response.
     1047        """
     1048        i = 0
     1049        t = topo.clone()
     1050        self.decorate_topology(starter, t)
    10351051        # Grab the log (this is some anal locking, but better safe than
    10361052        # sorry)
     
    12461262        info = self.info_segment(keyfile=self.ssh_privkey_file,
    12471263                debug=self.create_debug, boss=self.boss, cert=self.xmlrpc_cert)
    1248         info(self, user, proj, ename, gid, nonce)
     1264        info(self, user, proj, ename)
     1265        self.decorate_topology(info, topo)
    12491266        return {
    12501267                'allocID': req['allocID'],
    1251                 'experimentdescription' { 'topdldescription' : topo.to_dict() },
     1268                'segmentdescription':
     1269                    { 'topdldescription' : topo.to_dict() },
    12521270                'proof': proof.to_dict(),
    12531271                }
    1254 
Note: See TracChangeset for help on using the changeset viewer.