Changeset 2396f591


Ignore:
Timestamp:
Jun 15, 2011 6:18:41 PM (14 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master
Children:
9b76f1a, cedf721
Parents:
b56eb7e
Message:

Correctly place lans in multi-grouping images

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/fedd_image.py

    rb56eb7e r2396f591  
    7171            add_to_map(sg, e.get_attribute(attr) or 'default', e)
    7272        elif isinstance(e, topdl.Substrate):
    73             # A little hairy.  Make a set of the values of the given attribute
     73            # A little hairy.  If the substrate itself has the attribute, use
     74            # that.  Otherwise, make a set of the values of the given attribute
    7475            # for all the elements in the substrate's interfaces.  If that set
    7576            # has one element, put the substrate in that subgraph.  Otherwise
    7677            # put it in default.
    77             atts = set([i.element.get_attribute(attr) or 'default' \
    78                     for i in e.interfaces])
    79 
    80             if len(atts) == 1: add_to_map(sg, atts.pop(), e)
    81             else: add_to_map(sg, 'default', e)
     78
     79            sa = e.get_attribute(attr)
     80            if sa is not None:
     81                add_to_map(sg, sa, e)
     82            else:
     83                atts = set([i.element.get_attribute(attr) or 'default' \
     84                        for i in e.interfaces])
     85
     86                if len(atts) == 1: add_to_map(sg, atts.pop(), e)
     87                else: add_to_map(sg, 'default', e)
    8288
    8389    if rest:
Note: See TracChangeset for help on using the changeset viewer.