Ignore:
Timestamp:
Apr 22, 2010 10:21:17 AM (14 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
Children:
76bcab2
Parents:
4c931af
Message:

Regular expression that accommodates appliances and virtual nodes better than the earlier one. Also for do not add project and experiment to pc\d+ nodenames.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/federation/local_emulab_segment.py

    r4c931af r935e46f  
    157157            self.log.debug("Getting mapping for %s %s" % (pid, eid))
    158158            phys_start = re.compile('^Physical\s+Node\s+Mapping')
    159             phys_line = re.compile('(\S+)\s+\S+\s+\S+\s+(.*)')
     159            phys_line = re.compile('(\S+)(\s+\S+)*\s+(\S+)')
    160160            phys_end = re.compile('^$')
    161161            status = subprocess.Popen(cmd, stdout=subprocess.PIPE,
     
    184184                else:
    185185                    m = phys_line.match(line.strip())
    186                     if m: self.node[m.group(1)] = m.group(2)
     186                    if m: self.node[m.group(1)] = m.group(3)
    187187                    else: self.log.warn(
    188                             "Matching failed while parsing node mapping")
     188                            "Matching failed while parsing node mapping: " +\
     189                                    "line %s" % line)
    189190            rv = status.wait()
    190191
Note: See TracChangeset for help on using the changeset viewer.