apache / libcloud

Apache Libcloud is a Python library which hides differences between different cloud provider APIs and allows you to manage different cloud resources through a unified and easy to use API.
https://libcloud.apache.org
Apache License 2.0
2.03k stars 925 forks source link

Creation of backup driver fails for EBS with region formatting issue #1634

Open rohan2962 opened 2 years ago

rohan2962 commented 2 years ago

Summary

Creating an EBS backup driver fails with region formatting issue

Detailed Information

apache-libcloud version 3.4.1 python 3.6

cls = libcloud.get_driver(libcloud.DriverType.BACKUP, libcloud.DriverType.BACKUP.EBS) backup_driver = cls(constants.CONFIG["aws_access_key"], constants.CONFIG["aws_secret_key"], region="ap-south-1") Traceback (most recent call last): File "", line 1, in File "/home/ec2-user/.local/lib/python3.6/site-packages/libcloud/backup/drivers/ebs.py", line 59, in init self.connection.host = HOST % (region) TypeError: not all arguments converted during string formatting

Unlike other AWS drivers, EBS does not have specific driver type per region. I suspect this is causing the issue.

Kami commented 2 years ago

Thanks for reporting this issue.

I'm looking at the code and I wonder if / how this ever worked since that code seems incorrect and would throw on every instantiation.

Kami commented 2 years ago

I'm trying to fix the driver since I thought it may be an easy fix, but it looks like the driver was never really fully implemented and working.

I fixed the region issue, but it looks like there are many other issues as well:

<?xml version="1.0" encoding="UTF-8"?>

NoSuchVersionThe requested version (2015-10-01) of service ManagedProxyService does not exist14ec4ef4-54f9-461f-aede-717b828f4fbe

I will push a branch with WIP changes, but as I said above, it likely needs much more work to get everything working.

Kami commented 2 years ago

With #1635, instantiating the driver and authenticating with the API now works, but I haven't tested much else and it's likely that other things are not working as well since we have no unit tests for this driver to verify the correctness.

rohan2962 commented 2 years ago

Thanks for the quick response and fix. Meanwhile, I see volumes functionality in compute driver itself like list_volumes() etc. Was the development of the specific driver not covered as the functionality was available elsewhere? This is speculative. Can somebody comment on this? Is there other functionality in this driver that is not available under the compute EC2 driver?

stale[bot] commented 2 years ago

Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically marking is as stale. If this issue is not relevant or applicable anymore (problem has been fixed in a new version or similar), please close the issue or let us know so we can close it. On the contrary, if the issue is still relevant, there is nothing you need to do, but if you have any additional details or context which would help us when working on this issue, please include it as a comment to this issue.