Open solarjoe opened 2 years ago
This check does not work as expected as is always True:
True
if response.status_code == 200 or 201:
https://github.com/SoftwareAG/cumulocity-python-agent/blob/e3f697136584b2d609f88cd6c624f858dd4a0d98/deviceRegistration/newDeviceRegistration.py#L62
Because Python reads it as if (response.status_code == 200) or 201
if (response.status_code == 200) or 201
https://docs.python.org/3/reference/expressions.html#operator-precedence
You would write is as if response.status_code in [200, 201]:
if response.status_code in [200, 201]:
This check does not work as expected as is always
True
:if response.status_code == 200 or 201:
https://github.com/SoftwareAG/cumulocity-python-agent/blob/e3f697136584b2d609f88cd6c624f858dd4a0d98/deviceRegistration/newDeviceRegistration.py#L62
Because Python reads it as
if (response.status_code == 200) or 201
https://docs.python.org/3/reference/expressions.html#operator-precedence