[openstack-dev] [WSME] Complex Type Validation Issue On Deserialization

Brandon Logan brandon.logan at RACKSPACE.COM
Thu Sep 11 04:45:14 UTC 2014


I'm having an issue where incoming validation of a complex type with a an attribute of type IPv4Address is failing validation when it is a correct ipv4 address.  Same is happening for UuidType and IPv6AddressType.  I am using using Pecan with WSME 0.6.1 and python 2.7.6.

Complex Type:
class LoadBalancer(wtypes.Base):
    ip_address = wtypes.wsattr(wtypes.IPv4AddressType)

Controller Method:
@pecan.wsexpose(v1types.LoadBalancer, body=v1types.LoadBalancer)
def post(self, load_balancer):
   return load_balancer


When doing a POST to the correct resource with this body:

{"ip_address": "10.0.0.1"}

I am getting this error:

{
debuginfo: null
faultcode: "Server"
faultstring: "Value should be IPv4 format"
}


it looks like in the fromjson method when it starts validating the actual ip "10.0.0.1" it is sending an instantiation of the IPv4AddressType instead of the actual ip address "10.0.0.1" to wsme.types.validate_value.  Am I doing something wrong or is this a bug?  The stack trace did not yield anymore information, unless you want the actual methods called.  I can provide that if needed.

Thanks,
Brandon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140911/28e18d2f/attachment.html>


More information about the OpenStack-dev mailing list