Azure / azure-uamqp-python

AMQP 1.0 client library for Python
MIT License
57 stars 48 forks source link

revert amqp mgmt string type check to avoid log error when description is null #235

Closed yunhaoling closed 3 years ago

yunhaoling commented 3 years ago

when servicebus mgmt operation succeeds, the service returns status code 200 and desc_value is of type AMQP_TYPE_NULL. we should not call amqpvalue_get_string on a NULL type.

issue: https://github.com/Azure/azure-sdk-for-python/issues/18361#issuecomment-828727089

revert the following check in v1.2.13 to avoid the misleading error log. (not sure why the changes get ignored when I was updating the dependency..)

AMQP_TYPE amqp_type = amqpvalue_get_type(desc_value);
if (amqp_type == AMQP_TYPE_STRING)
{
...
}

see code in v1.2.13 here: https://github.com/Azure/azure-uamqp-python/blob/v1.2.13/src/vendor/azure-uamqp-c/src/amqp_management.c#L201-L210 (originally from PR: https://github.com/Azure/azure-uamqp-python/pull/102)