Ignore:
Timestamp:
Sep 3, 2009 6:51:50 PM (15 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-2.00, version-3.01, version-3.02
Children:
f5ae004
Parents:
66861a2
Message:

checkpoint

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/topdl.py

    r66861a2 recca6eb  
    231231    def clone(self):
    232232        return ID(self.fedid, self.uuid, self.uri, self.localname,
    233                 self.kernberosUsername)
     233                self.kerberosUsername)
    234234
    235235    def to_dict(self):
     
    327327        return Segment(self.id.clone(), self.type, self.uri,
    328328                interface=[i.clone() for i in self.interface],
    329                 attribute=[a.clone() for a in attribute])
     329                attribute=[a.clone() for a in self.attribute])
    330330
    331331    def to_dict(self):
     
    579579
    580580def to_tcl_name(n):
    581     t = re.subst('-(\d+)', '(\1)', n)
     581    t = re.sub('-(\d+)', '(\1)', n)
    582582    return t
     583
     584def generate_portal_command_filter(cmd):
     585    def rv(e):
     586        s =""
     587        if isinstance(e, Computer):
     588            gw = e.get_attribute('portal')
     589            if gw:
     590                s = "%s $%s\n" % (cmd, to_tcl_name(e.name[0]))
     591        return s
     592    return rv
    583593
    584594def generate_portal_image_filter(image):
     
    588598            gw = e.get_attribute('portal')
    589599            if gw:
    590                 s = "tb-set-node-os $%s %s" % (to_tcl_name(e.name[0]), image)
     600                s = "tb-set-node-os $%s %s\n" % (to_tcl_name(e.name[0]), image)
    591601        return s
    592602    return rv
    593603
    594 def generate_portal_command_filter(cmd):
     604def generate_portal_hardware_filter(type):
    595605    def rv(e):
    596606        s =""
     
    598608            gw = e.get_attribute('portal')
    599609            if gw:
    600                 s = "%s $%s" % (cmd, to_tcl_name(e.name[0]))
     610                s = "tb-set-hardware $%s %s\n" % (to_tcl_name(e.name[0]), type)
    601611        return s
    602612    return rv
     
    620630                if osid:
    621631                    out += "tb-set-node-os $%s %s\n" % (name, osid)
     632            hw = e.get_attribute('type')
     633            if hw:
     634                out += "tb-set-hardware $%s %s\n" % (name, hw)
    622635            for s in e.software:
    623636                if s.install:
Note: See TracChangeset for help on using the changeset viewer.