Profile/Policy Spec-Version should always be type of string

Bug #1770259 reported by Jack Kuei
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
senlin
New
Undecided
Unassigned

Bug Description

There is inconsistent type for json api for Spec-Version, in some cases, "version": 1.0 (int), while other cases "version": "1.0" (string).

In the following example trace, the first profile contains int 1.0, while the second profile contains string "1.0"

GET /v1/profiles HTTP/1.1
Openstack-Api-Version: clustering 1.5

HTTP/1.1 200 OK
Openstack-Api-Version: clustering 1.5
Vary: OpenStack-API-Version
Content-Type: application/json
Content-Length: 16417
X-Openstack-Request-Id: req-b164dcba-67ca-4eab-b288-f29fa32a1186
Date: Wed, 09 May 2018 19:56:30 GMT
Connection: close

{"profiles": [{"created_at": "2017-09-29T02:11:18Z", "domain": null, "id": "d5b3aafd-ed76-465f-ba69-7aa3ddd2a8e0", "metadata": {}, "name": "eric-autoscaling-centos73", "project": "b779ad84b8184000a5fd114796bc4c72", "spec": {"properties": {"flavor": "t2.small", "image": "centos7.3-latest", "metadata": {"test_key": "test_value"}, "networks": [{"network": "sandbox-internal-net"}], "user_data": "#!/bin/sh\nset -x\n\nSWIFT_URL=\"http://dev.swift.cloud.blizzard.net:8081/v1/AUTH_b779ad84b8184000a5fd114796bc4c72\"\nyum -y install wget\nwget ${SWIFT_URL}/dev-autoscaling-private/bootstrap.sh -O /tmp/bootstrap.sh\nchmod +x /tmp/bootstrap.sh\n/tmp/bootstrap.sh | /usr/bin/tee -a /var/log/bootstrap.log\n"}, "type": "os.nova.server", "version": 1.0}, "type": "os.nova.server-1.0", "updated_at": null, "user": "ebe2bdcdb325d2445c427f54484294a98a5d2e1baa61a6fe0f309c566d4fc7a5"},
.....
.....
{"created_at": "2018-05-09T16:47:12Z", "domain": null, "id": "27bbc280-e54b-404c-9a6a-34d57ea18b27", "metadata": {"foo": "bar", "test": "123"}, "name": "TESTACC-frjgvdJs", "project": "b779ad84b8184000a5fd114796bc4c72", "spec": {"properties": {"flavor": "t2.micro", "image": "centos7.3-latest", "name": "centos-server", "networks": [{"network": "sandbox-internal-net"}], "security_groups": ""}, "type": "os.nova.server", "version": "1.0"}, "type": "os.nova.server-1.0", "updated_at": null, "user": "16fb286b76c032a2123cd2788aff87377426d77c9bcfc92beb2065dbe4ff2417"}, {"created_at": "2018-05-09T17:11:45Z", "domain": null, "id": "22894d76-ad51-4cd4-a9b2-b3daeb7d7ef6", "metadata": {"foo": "bar", "test": "123"}, "name": "TESTACC-mx0dX3DK", "project": "b779ad84b8184000a5fd114796bc4c72", "spec": {"properties": {"flavor": "t2.micro", "image": "centos7.3-latest", "name": "centos-server", "networks": [{"network": "sandbox-internal-net"}], "security_groups": ""}, "type": "os.nova.server", "version": "1.0"}, "type": "os.nova.server-1.0", "updated_at": null, "user": "16fb286b76c032a2123cd2788aff87377426d77c9bcfc92beb2065dbe4ff2417"}]}

Revision history for this message
Deepak Mourya (mourya007) wrote :

I think doc also specified the version in the integer form https://developer.openstack.org/api-ref/clustering/#list-profiles

Revision history for this message
Jack Kuei (jkuei) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.