KnpLabs/KnpGaufretteBundle

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

chadyred opened this issue · 5 comments

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 !

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

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

Yes, I fix this.

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

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