Opened 12 years ago

Closed 12 years ago

#31 closed (fixed)

the Sliver.slices parameter needs improvement

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

Description

The Sliver class has a parameter called slices, which is a list. There are a few problems with this:

  1. There is no setter for this parameter
  2. A sliver can belong to at most one slice, so this should be a single parameter, not a list
  3. I don't think it should be legal to define a sliver with no slice, so this should be a mandatory parameter

Change History (6)

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

Fully completing 3 may require the ability to query the GMOC server for slices, since, in general, an aggregate will create Sliver objects, and will not be the one creating Slice objects from scratch.

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

This bug is still active. There is now a slices setter in Sliver. (I haven't tested it.)

However, 2 is still definitely active: a sliver belongs to one slice, so this should not be a list unless i am misunderstanding something about what this parameter is for. Am i?

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

Keywords: v0.2.0 added

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

Keywords: v0.2.1 added; v0.2.0 removed

In v0.2.1, there is only one slice per sliver (so 2 is fixed), but there is once again no setter for the property:

  slivers[sliver].slice = sinfo['slice_urn']

yields:

Traceback (most recent call last):
  File "./report_foam_relations", line 243, in <module>
    slivers[sliver].slice = sinfo['slice_urn']
AttributeError: can't set attribute

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

Keywords: v0.3.0 added; v0.2.1 removed

In v0.3.0, the slice setter is defined, but is a noop. The code:

  print "before: %s" % slivers[sliver].slice
  slivers[sliver].slice = slices[sinfo['slice_urn']]
  print "after:  %s" % slivers[sliver].slice

yields:

before: None
after:  None

So this bug is still active.

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

Resolution: fixed
Status: newclosed

Item 2 is fixed: now:

  print "before: %s" % slivers[sliver].slice
  slivers[sliver].slice = slices[sinfo['slice_urn']]
  print "after:  %s" % slivers[sliver].slice

yields:

before: None
after:  <gmoc.Slice object at 0xa2e47ac>

Good enough.

Note: See TracTickets for help on using tickets.