rackspace / gophercloud

A Go SDK for OpenStack. IN FEATURE FREEZE. See Issue #592
http://gophercloud.io
Other
456 stars 180 forks source link

problems with Authentication #512

Closed DavidSie closed 8 years ago

DavidSie commented 8 years ago

Hello, I am currently using Terraform with openstack provider, and since I saw in code it uses your package to authenticate:

{
            "ImportPath": "github.com/rackspace/gophercloud",
            "Comment": "v1.0.0-247-g1913130",
            "Rev": "191313005ef1b17fae341a28f3db7ce3414d05df"
        }

I thought it better to rise issue here rather than there https://github.com/jtopjian/terraform-provider-openstack

when I use nova everything is fine

 nova list
~/anaconda/lib/python3.4/site-packages/novaclient/v1_1/__init__.py:30: UserWarning: Module novaclient.v1_1 is deprecated (taken as a basis for novaclient.v2). The preferable way to get client class or object you can find in novaclient.client module.
  warnings.warn("Module novaclient.v1_1 is deprecated (taken as a basis for "
+--------------------------------------+------------+--------+------------+-------------+----------------------------+
| ID                                   | Name       | Status | Task State | Power State | Networks                   |
+--------------------------------------+------------+--------+------------+-------------+----------------------------+
| 16ff9e64-8578-4287-bfd1-858e0a0d6d13 | testserver | ACTIVE | -          | Running     | internal_shared=some_ip |
| 4e34fc97-ff22-450c-ba4b-0e8331f72b89 | testserver | ACTIVE | -          | Running     | internal_shared=some_ip |
+--------------------------------------+------------+--------+------------+-------------+----------------------------+

but when I use terraform I get

terraform plan
Refreshing Terraform state prior to plan...

Error refreshing state: 1 error(s) occurred:

* Expected HTTP response code [200 203] when accessing [POST https://console.client_domain.com:4430/v2.0/tokens], but got 401 instead
{"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}}

I'll be very happy if you could help me find solution or some workaround.

jrperritt commented 8 years ago

A few suggestions:

  1. You should consider using Terraform proper. OpenStack support for it was added earlier this year: https://github.com/hashicorp/terraform/tree/master/builtin/providers/openstack
  2. Have a look at the documentation: https://terraform.io/docs/providers/openstack/index.html. If you are still experiencing issues after consulting the documentation, you should file an issue in the repository of the library you're using (whether it's terraform-provider-openstack or terraform proper).
DavidSie commented 8 years ago

Ok, thank you