glance-api fails if cinder_volume_type is set and auth data is not overriden

Bug #2058069 reported by Jorge Merlino
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
glance_store
New
Undecided
Unassigned

Bug Description

When configuring multiple cinder storage backends in glance-api.conf a volume type must be configured using the cinder_volume_type configuration option. If this parameter is set but not all of these parameters are set also:

cinder_store_user_name
cinder_store_password
cinder_store_project_name
cinder_store_auth_address

glance-api will not start. These last four parameters are supposed to be optional and the default context should be used if they are not present.

The issue arises on the _drivers/cinder/store.py file, in particular starting on the configure_add function. This function invokes self.get_cinderclient() (line 533) with no parameters if cinder_volume_type is present. So, in this function invocation the context paramter is None and the legacy_update parameter is False (default values of the parameters). Thus, if any of the mentioned four parameters is not set, the self.is_user_overriden() method call will also return false. In this case, where legacy_update and user_overriden are both false, get_cinderclient will reach line 606 where username is set to context.user_id. But in this function path, context still has its default value (None) and glance-api will fail showing this error in the systemd journal:

ERROR: 'NoneType' object has no attribute 'user_id'

In this case, context should be set to the default context before reaching this line.

description: updated
description: updated
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.