Changeset 6a50b78


Ignore:
Timestamp:
Feb 5, 2012 7:29:57 PM (13 years ago)
Author:
Ted Faber <faber@…>
Branches:
compt_changes, master
Children:
25930db
Parents:
e8979e2
Message:

Initial benito plug in. Fixed bug pickling topdl as well

Location:
fedd
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • fedd/deter/topdl.py

    re8979e2 r6a50b78  
    250250        return rv
    251251
     252    def __getstate__(self):
     253        d = self.__dict__.copy()
     254        del d['interfaces']
     255        return d
     256
     257    def __setstate__(self, d):
     258        # Import everything from the pickle dict (except what we excluded in
     259        # __getstate__)
     260        self.__dict__.update(d)
     261        self.interfaces = []
     262
    252263class CPU(base):
    253264    def __init__(self, type, attribute=[]):
     
    417428                    for a in self.attribute], "")
    418429        return rv
     430
     431    def __getstate__(self):
     432        d = self.__dict__.copy()
     433        del d['subs']
     434        return d
     435
     436    def __setstate__(self, d):
     437        # Import everything from the pickle dict (except what we excluded in
     438        # __getstate__)
     439        self.__dict__.update(d)
     440        self.subs = []
    419441
    420442
     
    813835        return rv
    814836
     837    def __setstate__(self, d):
     838        # Import everything from the pickle dict and call incorporate to
     839        # connect them.
     840        self.__dict__.update(d)
     841        self.incorporate_elements()
     842
    815843
    816844def topology_from_xml(string=None, file=None, filename=None, top="topology"):
     
    891919        xp.ParseFile(file)
    892920    elif string:
    893         xp.Parse(string, isfinal=True)
     921        xp.Parse(string, True)
    894922    else:
    895923        return None
  • fedd/federation/deter_impl.py

    re8979e2 r6a50b78  
    77import protogeni_access
    88import deter_internal_access
     9import benito_access
    910import skeleton_access
    1011
     
    8687                    self.access = deter_internal_access.access(config,
    8788                            self.auth)
     89                if self.access_type == "benito":
     90                    self.access = benito_access.access(config, self.auth)
    8891                elif self.access_type == "skel":
    8992                    self.access = skeleton_access.access(config, self.auth)
  • fedd/federation/experiment_control.py

    re8979e2 r6a50b78  
    20382038                try:
    20392039                    vis = self.genviz(
    2040                             topdl.topology_to_vtopo(self.state[key].topo))
     2040                            topdl.topology_to_vtopo(self.state[key].top))
    20412041                except service_error, e:
    20422042                    self.state_lock.release()
     
    22972297        if key in self.state:
    22982298            if force or self.state[key].older_than(self.info_cache_limit):
    2299                 top = self.state[key].top 
     2299                top = self.state[key].top
    23002300                if top is not None: top = top.clone()
    23012301                d1, info_params, cert, d2 = \
     
    23682368            # Copy the topo if we need legacy annotations
    23692369            if legacy:
    2370                 top = self.state[key].top 
     2370                top = self.state[key].top
    23712371                if top is not None: top = top.clone()
    23722372        self.state_lock.release()
Note: See TracChangeset for help on using the changeset viewer.