Changeset ecca6eb for fedd/federation/topdl.py
- Timestamp:
- Sep 3, 2009 6:51:50 PM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-2.00, version-3.01, version-3.02
- Children:
- f5ae004
- Parents:
- 66861a2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/topdl.py
r66861a2 recca6eb 231 231 def clone(self): 232 232 return ID(self.fedid, self.uuid, self.uri, self.localname, 233 self.ker nberosUsername)233 self.kerberosUsername) 234 234 235 235 def to_dict(self): … … 327 327 return Segment(self.id.clone(), self.type, self.uri, 328 328 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]) 330 330 331 331 def to_dict(self): … … 579 579 580 580 def to_tcl_name(n): 581 t = re.sub st('-(\d+)', '(\1)', n)581 t = re.sub('-(\d+)', '(\1)', n) 582 582 return t 583 584 def 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 583 593 584 594 def generate_portal_image_filter(image): … … 588 598 gw = e.get_attribute('portal') 589 599 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) 591 601 return s 592 602 return rv 593 603 594 def generate_portal_ command_filter(cmd):604 def generate_portal_hardware_filter(type): 595 605 def rv(e): 596 606 s ="" … … 598 608 gw = e.get_attribute('portal') 599 609 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) 601 611 return s 602 612 return rv … … 620 630 if osid: 621 631 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) 622 635 for s in e.software: 623 636 if s.install:
Note: See TracChangeset
for help on using the changeset viewer.