Comment 4 for bug 1878481

Revision history for this message
peter eisch (peterbokunet) wrote :

Something is weird and/or I need to learn more:

[peisch@commander cinder-look]$ cat atx-admin_cinder.json
{ "auth": {
    "identity": {
      "methods": ["password"],
      "password": {
        "user": {
          "name": "atx_cinder",
          "domain": { "id": "default" },
          "password": "329na2Tb$80g"
        }
      }
    }
  }
}
[peisch@commander cinder-look]$ echo $TOKEN

[peisch@commander cinder-look]$ curl -vs -X GET http://10.180.0.142:8776/v3/ -H "User-Agent: python-cinderclient" -H "Accept: application/json" -H "X-Auth-Token: $TOKEN"; echo
* About to connect() to 10.180.0.142 port 8776 (#0)
* Trying 10.180.0.142...
* Connected to 10.180.0.142 (10.180.0.142) port 8776 (#0)
> GET /v3/ HTTP/1.1
> Host: 10.180.0.142:8776
> User-Agent: python-cinderclient
> Accept: application/json
>
< HTTP/1.1 401 Unauthorized
< Content-Type: application/json
< Content-Length: 114
< Www-Authenticate: Keystone uri="https://keystone-s00.xxx.cloud/v3"
< X-Openstack-Request-Id: req-6f9ecdac-561c-4c2a-93be-401b42158e5e
< Date: Mon, 18 May 2020 15:41:53 GMT
<
* Connection #0 to host 10.180.0.142 left intact
{"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}}
I was expecting this outcome as it hadn't any auth.

[peisch@commander cinder-look]$ export TOKEN=`curl -si -d @atx-admin_cinder.json -H "Content-type: application/json" https://keystone-a00.xxx.cloud/v3/auth/tokens|awk '/X-Subject-Token/ {print $2}'`
[peisch@commander cinder-look]$ curl -vs -X GET http://10.180.0.142:8776/v3/ -H "User-Agent: python-cinderclient" -H "Accept: application/json" -H "X-Auth-Token: $TOKEN"; echo
* About to connect() to 10.180.0.142 port 8776 (#0)
* Trying 10.180.0.142...
* Connected to 10.180.0.142 (10.180.0.142) port 8776 (#0)
> GET /v3/ HTTP/1.1
> Host: 10.180.0.142:8776
> User-Agent: python-cinderclient
> Accept: application/json
> X-Auth-Token: gAAAAABewqziIAkl9ZALaVALfwDlUD_ZoisMNpQv-AbvErzM95yd9n91_hEPhqMR-rF9ntjTyjWsHaBJjKlKqJ7KaL00oEBNOQCC6tcjfxFabBAy1dcg3yTyMXpheg-McDd4rfQstEj3RZp7jWD1S6acQLiqLO8f4OWpWe7p5PM5MWzpVG824a0
>
< HTTP/1.1 200 OK
< X-Compute-Request-Id: req-c126150d-f6c7-4397-b3cc-ac561a6e9f16
< Content-Type: application/json
< Content-Length: 389
< Openstack-Api-Version: volume 3.0
< Vary: OpenStack-API-Version
< X-Openstack-Request-Id: req-c126150d-f6c7-4397-b3cc-ac561a6e9f16
< Date: Mon, 18 May 2020 15:42:33 GMT
<
* Connection #0 to host 10.180.0.142 left intact
{"versions": [{"status": "CURRENT", "updated": "2018-07-17T00:00:00Z", "links": [{"href": "https://docs.openstack.org/", "type": "text/html", "rel": "describedby"}, {"href": "https://cinder-s00.xxx.cloud/v3/", "rel": "self"}], "min_version": "3.0", "version": "3.55", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.volume+json;version=3"}], "id": "v3.0"}]}

With auth, I get results, but now when I query volumes:

[peisch@commander cinder-look]$ curl -vs -X GET http://10.176.0.142:8776/v3/1134ba6f01ef43f49961aa6bbe49f5bc/volumes -H "User-Agent: python-cinderclient" -H "Accept: application/json" -H "X-Auth-Token: $TOKEN"; echo
* About to connect() to 10.176.0.142 port 8776 (#0)
* Trying 10.176.0.142...
* Connected to 10.176.0.142 (10.176.0.142) port 8776 (#0)
> GET /v3/1134ba6f01ef43f49961aa6bbe49f5bc/volumes HTTP/1.1
> Host: 10.176.0.142:8776
> User-Agent: python-cinderclient
> Accept: application/json
> X-Auth-Token: gAAAAABewqziIAkl9ZALaVALfwDlUD_ZoisMNpQv-AbvErzM95yd9n91_hEPhqMR-rF9ntjTyjWsHaBJjKlKqJ7KaL00oEBNOQCC6tcjfxFabBAy1dcg3yTyMXpheg-McDd4rfQstEj3RZp7jWD1S6acQLiqLO8f4OWpWe7p5PM5MWzpVG824a0
>
< HTTP/1.1 400 Bad Request
< Openstack-Api-Version: volume 3.0
< Vary: OpenStack-API-Version
< Content-Length: 65
< Content-Type: application/json
< X-Compute-Request-Id: req-7d0d360b-ab13-4c4e-b52a-3415bcb8bbf4
< X-Openstack-Request-Id: req-7d0d360b-ab13-4c4e-b52a-3415bcb8bbf4
< Date: Mon, 18 May 2020 15:49:15 GMT
<
* Connection #0 to host 10.176.0.142 left intact
{"badRequest": {"message": "Malformed request url", "code": 400}}
[peisch@commander cinder-look]$