Opened 12 years ago

Closed 12 years ago

#40 closed (fixed)

class Aggregate throws "TypeError: __call__() got an unexpected keyword argument 'type'" when given any optional argument

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

I haven't checked whether this is true for other classes yet, but wanted to file the bug as quickly as possible:

  • The code:
    aggregate = gmoc.Aggregate(
                  info['site_tag'],
                )
    print aggregate
    
    yields:
    <gmoc.Aggregate object at 0x8d025cc>
    
  • The code:
    aggregate = gmoc.Aggregate(
                  info['site_tag'],
                  type = 'foam',
                )
    print aggregate
    
    yields:
    Traceback (most recent call last):
      File "./report_foam_relations", line 190, in <module>
        type = 'foam',
    TypeError: __call__() got an unexpected keyword argument 'type'
    

I see the same issue if i include any one of the optional keywords that Aggregate should take, e.g.:

Traceback (most recent call last):
  File "./report_foam_relations", line 191, in <module>
    version = info['version'],
TypeError: __call__() got an unexpected keyword argument 'version'

or

Traceback (most recent call last):
  File "./report_foam_relations", line 192, in <module>
    pop = config['POPNAME'],
TypeError: __call__() got an unexpected keyword argument 'version'

or

Traceback (most recent call last):
  File "./report_foam_relations", line 193, in <module>
    operator = organization,
TypeError: __call__() got an unexpected keyword argument 'operator'

I believe i see the same thing when defining a resource, so my guess is that this bug affects several object types.

Change History (4)

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

Priority: criticalblocker

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

Priority: blockermajor

Kevin says:

I forgot to make __call__ handle keyword arguments.  However, it should handle
ordinal args, so Aggregate(info['site_tag'], 'foam', ...) ought to work in the
meantime.

Confirmed. Dropping the priority to major.

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

Resolution: fixed
Status: newclosed

Keyword arguments work again in v0.2.1.

Note: See TracTickets for help on using tickets.