Opened 12 years ago

Closed 12 years ago

#41 closed (fixed)

typo in Resources.slices and Aggregate.slices getters

Reported by: chaos@bbn.com Owned by: somebody
Priority: major Milestone: 2012-09-04 client release
Component: Clients Version:
Keywords: v0.2.0 Cc:
Dependencies:

Description

The class Resources has a slices getter:

    def slices(self):
        slices = {}

        for sliver in self.__slivers:
            for slice in sliver.slices:
                slices[slice.id] = slice

However, the sliver list in Resources is named _slivers not __slivers, so this throws an error:

  File "/home/chaos/gmoc.py", line 969, in slices
    for sliver in self.__slivers:
AttributeError: 'Resource' object has no attribute '_Resource__slivers'

Change History (2)

comment:1 Changed 12 years ago by chaos@bbn.com

Summary: typo in Resources.slices gettertypo in Resources.slices and Aggregate.slices getters

This typo also exists in Aggregate.slices, so i modified the summary:

  File "/home/chaos/gmoc.py", line 751, in slices
    for sliver in self.__slivers:
AttributeError: 'Aggregate' object has no attribute '_Aggregate__slivers'

comment:2 Changed 12 years ago by chaos@bbn.com

Resolution: fixed
Status: newclosed

The Aggregate.slices getter works in 0.2.1:

print [s.id for s in aggregate.slices]
aggregate.slivers = slivers.values()
print [s.id for s in aggregate.slices]

yields:

[]
['urn:publicid:IDN+pgeni.gpolab.bbn.com+slice+chaos-poblano1101-datapath', 'urn:publicid:IDN+pgeni.gpolab.bbn.com+slice+chaos-montreve-macaddr']

I don't have resource/sliver mappings working yet in my code, but resource.slices returns an empty array without error, so this typo is fixed there too.

Note: See TracTickets for help on using tickets.