micafer opened a new issue #1491:
URL: https://github.com/apache/libcloud/issues/1491


   ## Summary
   
   If you set any of the ex_force_image_url, ex_force_volume_url, 
ex_force_network_url without setting ex_force_base_url in case of using 
api_value >= 2 there is an error that base_url is set to the image, volume or 
network url instead of the base one.
   
   ## Detailed Information
   
   It has been tested with libcloud versions 2.8.3+
   
   This code causes the error:
   
   ```python
   from libcloud.compute.types import Provider
   from libcloud.compute.providers import get_driver
   
   OpenStack = get_driver(Provider.OPENSTACK)
   driver = OpenStack('user', 'pass',
                              ex_tenant_name='tenant',
                              ex_domain_name='domain',
                              ex_force_auth_url='https://server:5000',
                              ex_force_auth_version='3.x_password',
                              ex_force_network_url = 'https://server:9696',
                              api_version='2.0')
   
   sizes = driver.list_sizes()
   ```
   This is the error shown:
   
   ```
   Traceback (most recent call last):
     File "test.py", line 14, in <module>
       sizes = driver.list_sizes()
     File 
"/usr/local/lib/python3.6/dist-packages/libcloud/compute/drivers/openstack.py", 
line 404, in list_sizes
       self.connection.request('/flavors/detail').object)
     File 
"/usr/local/lib/python3.6/dist-packages/libcloud/common/openstack.py", line 
237, in request
       raw=raw)
     File "/usr/local/lib/python3.6/dist-packages/libcloud/common/base.py", 
line 648, in request
       response = responseCls(**kwargs)
     File 
"/usr/local/lib/python3.6/dist-packages/libcloud/compute/drivers/openstack.py", 
line 1130, in __init__
       super(OpenStack_1_1_Response, self).__init__(*args, **kwargs)
     File "/usr/local/lib/python3.6/dist-packages/libcloud/common/base.py", 
line 159, in __init__
       message=self.parse_error(),
     File 
"/usr/local/lib/python3.6/dist-packages/libcloud/common/openstack.py", line 
406, in parse_error
       if len(values) > 0 and 'code' in values[0] and \
   TypeError: argument of type 'int' is not iterable
   ```
   
   The real error is produced because the lib is trying to connect to this url: 
"https://server:9696/flavors/detail"; instead of getting the correct url of the 
nova service.
   
   The error raise is caused as the returned error code does not have the 
expected format of the errors in case of the API.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to