Skip to content

Error about update_device_token() method #9

@crazygj

Description

@crazygj

When call method update_device_token(deviceId), it return

Traceback (most recent call last):
  File "/home/samsung/guojia/ArtikAutoTest/ArtikCloudSDK/CloudSDK.py", line 121, in <module>
    deviceToken = d.updateDeviceToken(deviceid)
  File "/home/samsung/guojia/ArtikAutoTest/ArtikCloudSDK/CloudSDK.py", line 110, in updateDeviceToken
    api_response = api_instance.update_device_token(ddid)
  File "build/bdist.linux-x86_64/egg/artikcloud/apis/devices_api.py", line 813, in update_device_token
  File "build/bdist.linux-x86_64/egg/artikcloud/apis/devices_api.py", line 891, in update_device_token_with_http_info
  File "build/bdist.linux-x86_64/egg/artikcloud/api_client.py", line 334, in call_api
  File "build/bdist.linux-x86_64/egg/artikcloud/api_client.py", line 157, in __call_api
  File "build/bdist.linux-x86_64/egg/artikcloud/api_client.py", line 376, in request
  File "build/bdist.linux-x86_64/egg/artikcloud/rest.py", line 224, in PUT
  File "build/bdist.linux-x86_64/egg/artikcloud/rest.py", line 174, in request
UnboundLocalError: local variable 'r' referenced before assignment

I found in file devices_api.py update_device_token_with_http_info() method, the header is defined as 'text/plain', it shoud be "application/json" right?

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['text/plain'])

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions