'Upload openstack image failed

I tried to upload an openstack image with ansible. The task failed with

Failed validating 'type' in schema['properties']['tags']:: 400 Bad Request: On instance['tags']:: u"['testtag']": 'items': {'maxLength': 255, 'type': 'string'},: 'type': 'array'}: Provided object does not match schema 'image': u"['testtag']" is not of type 'array': {'description': u'List of strings related to the image',",

Here is my ansible task:

- os_image:
    name: test_image
    auth: "{{os_auth}}"
    container_format: bare
    disk_format: raw
    tags: [testtag]
    state: present
    filename: /var/lib/test_image.raw

I have changed it to - testtag1 with new indent line however the error message its showing the quote:

u"['testtag1']" is not of type 'array': Failed validating 'type' in schema['properties']['tags']:: 400 Bad Request: On instance['tags']:: 'items': {'maxLength': 255, 'type': 'string'},: 'type': 'array'}: u"['testtag1']": {'description': u'List of strings related to the image',",


Solution 1:[1]

my error is like this.

{"changed": false, "extra_data": {"data": null, "details": "400 Bad Request: Failed validating &#x27;type&#x27; in schema[&#x27;properties&#x27;][&#x27;protected&#x27;]:: &#x27;False&#x27;: Provided object does not match schema &#x27;image&#x27;: &#x27;False&#x27; is not of type &#x27;boolean&#x27;: &#x27;type&#x27;: &#x27;boolean&#x27;}: {&#x27;description&#x27;: &#x27;If true, image will not be deletable.&#x27;,: On instance[&#x27;protected&#x27;]:", "response": "<html>\n <head>\n  <title>400 Bad Request</title>\n </head>\n <body>\n  <h1>400 Bad Request</h1>\n  Provided object does not match schema &#x27;image&#x27;: &#x27;False&#x27; is not of type &#x27;boolean&#x27;\n\nFailed validating &#x27;type&#x27; in schema[&#x27;properties&#x27;][&#x27;protected&#x27;]:\n    {&#x27;description&#x27;: &#x27;If true, image will not be deletable.&#x27;,\n     &#x27;type&#x27;: &#x27;boolean&#x27;}\n\nOn instance[&#x27;protected&#x27;]:\n    &#x27;False&#x27;<br /><br />\n\n\n\n </body>\n</html>"}, "msg": "BadRequestException: 400: Client Error for url: http://192.168.1.9:9292/v2/images, 400 Bad Request: Failed validating &#x27;type&#x27; in schema[&#x27;properties&#x27;][&#x27;protected&#x27;]:: &#x27;False&#x27;: Provided object does not match schema &#x27;image&#x27;: &#x27;False&#x27; is not of type &#x27;boolean&#x27;: &#x27;type&#x27;: &#x27;boolean&#x27;}: {&#x27;description&#x27;: &#x27;If true, image will not be deletable.&#x27;,: On instance[&#x27;protected&#x27;]:"}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Aref