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

Ceph S3 Outscale storage driver fixes #792

Closed
wants to merge 2 commits into from

Conversation

jmunhoz
Copy link
Contributor

@jmunhoz jmunhoz commented May 20, 2016

  • Simplify the Outscale driver
  • Remove unused Outscale connection classes
  • Fix default signature v2 issue with the Outscale driver

Signed-off-by: Javier M. Mellid jmunhoz@igalia.com

- Simplify the Outscale driver
- Remove unused Outscale connection classes
- Fix default signature v2 issue with the Outscale driver

Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
@Kami
Copy link
Member

Kami commented May 20, 2016

@jmunhoz Thanks!

Can you please also add some tests - at least the one which instantiate both drivers and verify that host, etc. on the connection class is set correctly (this should be easy to do and be a bare minimum).

@jmunhoz jmunhoz force-pushed the s3-rgw-outscale-driver-fixes branch from e7958fa to da03572 Compare May 20, 2016 15:15
- Basic testing support covering RGW/Outscale storage drivers

Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
@jmunhoz jmunhoz force-pushed the s3-rgw-outscale-driver-fixes branch from da03572 to f7eba95 Compare May 20, 2016 15:17
@jmunhoz
Copy link
Contributor Author

jmunhoz commented May 20, 2016

@Kami I pushed some test cases covering both drivers.

@asfgit asfgit closed this in 0062f8b May 22, 2016
asfgit pushed a commit that referenced this pull request May 22, 2016
- Basic testing support covering RGW/Outscale storage drivers

Closes #792

Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
Signed-off-by: Tomaz Muraus <tomaz@tomaz.me>
@Kami
Copy link
Member

Kami commented May 22, 2016

Thanks.

I've added some additional asserts (084ce3c) and merged changes into trunk. I believe there is still a bug with they way the host is handled though:

       ....
        self.driver_v2 = self.driver_type(*self.driver_args,
                                          signature_version='2',
                                          host='host1')
        self.driver_v4 = self.driver_type(*self.driver_args,
                                          signature_version='4',
                                          host='host2')

        print self.driver_v2.connectionCls.host
        print self.driver_v4.connectionCls.host

And when running it:

osu.eu-west-2.outscale.com
osu.eu-west-2.outscale.com

As you can see, the host argument is ignored. That's probably because when connectionCls is instantiated, the host argument you set in the driver class constructor is overridden - as mentioned before, I recommend you to use _ex_connection_class_kwargs method. Overriding class variables is usually not a good idea, because it results in bugs and issues like that.

It would be great if you can look into it and also add corresponding tests (I didn't include those tests in the commit so it would cause the build to fail). When working on a fix, you can start with a failing test case :)

@jmunhoz
Copy link
Contributor Author

jmunhoz commented May 23, 2016

Thanks @Kami I reviewed the test case and I think it is working as expected. The Outscale driver maps valid Outscale regions to the Outscale hosts. It should not let arbitrary hosts.

In this case, if you don't add any explicit valid region the Outscale driver works with the default region and it assigns the default host 'osu.eu-west-2.outscale.com'. The default region/host is the same for AWS2 and AWS4. It is the reason to see the same default host twice.

You can have a look in this line https://github.com/apache/libcloud/blob/trunk/libcloud/storage/drivers/rgw.py#L116

Maybe it makes sense raising an expection when host is not none? Something similar to:

   if region not in S3_RGW_OUTSCALE_HOSTS_BY_REGION:
      raise LibcloudError('Unknown region (%s)' % (region), driver=self)
   if host is not None:
      raise LibcloudError('This driver does not accept arbitrary host', driver=self)
   host = S3_RGW_OUTSCALE_HOSTS_BY_REGION[region]

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

Successfully merging this pull request may close these issues.

2 participants