Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use OpenStack insteadof OpenCloud with 1-x branch of Gaufrette component #235

Open
chadyred opened this issue Mar 11, 2020 · 5 comments
Open
Assignees

Comments

@chadyred
Copy link

Hello,

I try to use the 1-x branch of gaufrette component package in order to use OpenStack to replace OpenCloud.

Firstly, I have to redefined Adapter definition as the Bundle wait for OpenCloud class in service definition.

Then I configure the objectStoreV1, but the error is :

Client error: `POST https://auth.cloud.ovh.net/v3/auth/tokens` resulted in a `404 Not Found` response:    {"error": {"message": "Failed to validate token", "code": 404, "title": "Not Found"}}  

This is the main configuration

services:
    knp_gaufrette.adapter.opencloud:
        class: Gaufrette\Adapter\OpenStack
        abstract: true
        arguments: ["first", "second", "third", "fourth"]

    opencloud.connection:
        class: OpenStack\OpenStack
        arguments:
             -
                tokenId: "%openstack_token%"
                region: "%openstack_object_storage_region%"
                authUrl: "%openstack_identity_url%"
                username: "%openstack_username%"
                password: "%openstack_password%"
                tenantName: "%openstack_tenant_name%" # v3 use token, v2 user authentication username
                tenantId: "%openstack_tenant_id%"
                debugLog: true

    opencloud.object_store:
        lazy: false
        class: OpenStack\ObjectStore\v1\Service
        factory: ["@opencloud.connection", objectStoreV1]
        arguments:
            -
                catalogName: "%openstack_object_catalog_type%"
                region: "%openstack_object_storage_region%"
                urlType: "%openstack_object_storage_url_type%"

Do I miss something ? Is it the good option for the adapter ?

Thanks !

@chadyred
Copy link
Author

I solve token request

services:
    knp_gaufrette.adapter.opencloud:
        class: Gaufrette\Adapter\OpenStack
        abstract: true
        arguments: ["first", "second", "third", "fourth"]

    opencloud.connection:
        class: OpenStack\OpenStack
        arguments:
             -
                tokenId: "%openstack_token%"
                region: "%openstack_object_storage_region%"
                authUrl: "%openstack_identity_url%"
                username: "%openstack_username%"
                password: "%openstack_password%"
                tenantName: "%openstack_tenant_name%" # v3 use toeken, v2 user authentication username
                tenantId: "%openstack_tenant_id%"
                debugLog: true
                user: { name: "%openstack_username%", password: "%openstack_password%", domain: { id: 'default', name: 'Default' } }
                scope: { project: { name: "%openstack_project_name%", id: "%openstack_project_id%", domain: { id: 'default', name: 'Default' }} }

But an error appear on setMetadata, the resetMetadata method return a FileNotFound on OpenStack 1-x branch for KnpGaufrette.

image

@steveWinter
Copy link

Did you ever solve this? OVH have no removed v2 access, so I'm trying to migrate to v3...

@chadyred
Copy link
Author

Yes, I fix this.

@chadyred
Copy link
Author

  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/chadyred/Gaufrette.git"
    }
  ],
  "require": {
    "knplabs/gaufrette" : "1.x-dev as v0.9.0",
}

@chadyred
Copy link
Author

Look my PR and the 2 commits : https://github.com/KnpLabs/Gaufrette/pull/636/commits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants