wsattr default arguments won't work with complex types

Bug #1227039 reported by Mehdi Abaakouk
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
WSME
Fix Released
High
Julien Danjou

Bug Description

When I use this :

class ComplexType(Base):
    myenum = wsattr(wtypes.Enum(str, 'or', 'and'), default='and')

And I don't set 'myenum' , myenum get wsme.types.Unset instead of the default value.

Julien Danjou (jdanjou)
Changed in wsme:
assignee: nobody → Julien Danjou (jdanjou)
status: New → Triaged
importance: Undecided → High
Revision history for this message
Julien Danjou (jdanjou) wrote :

It works with int and str says Mehdi, but doesn't work with array of complex type other than Enum for examples.

summary: - wsattr default arguments won't work with wsme.EnumType
+ wsattr default arguments won't work with complex types
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to wsme (master)

Fix proposed to branch: master
Review: https://review.openstack.org/47189

Changed in wsme:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to wsme (master)

Reviewed: https://review.openstack.org/47189
Committed: http://github.com/stackforge/wsme/commit/33d7aabf418b7be4bf21ce2fa311e8fd0a54eb17
Submitter: Jenkins
Branch: master

commit 33d7aabf418b7be4bf21ce2fa311e8fd0a54eb17
Author: Julien Danjou <email address hidden>
Date: Wed Sep 18 17:25:46 2013 +0200

    Add a test case for wsattr default

    Change-Id: Icb3a9456a52c74af004c749ba247df1ddaf73d19
    Fixes-Bug: #1227039

Changed in wsme:
status: In Progress → Fix Committed
Revision history for this message
Madhuri Kumari (madhuri-rai07) wrote :

Hi Julien,

I am using wsme 0.7.0 and this problem seems not resolved for complex types.
Eg:
 a = wsme.wsattr(wtypes.IntegerType(minimum=1), default=1)

The default value of a is not set to 1.
Can you tell me why?

Changed in wsme:
milestone: none → 0.8.0
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.