incorrect os-credentials handling

Bug #1806732 reported by Dmitrii Shcherbakov
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Prometheus Openstack Exporter Charm
Triaged
Medium
Unassigned

Bug Description

The charm currently incorrectly handles os-credentials passed to it.

symbolic project_domain_name and project_name are optional with default values hard-coded, however, project_id and project_domain_id are mandatory because they are retrieved unconditionally.

This prevents one from using just symbolic names and is also potentially harmful for the openstack client because it only needs either symbolic names or IDs (a mix is possible but probably not justified).

https://git.launchpad.net/prometheus-openstack-exporter-charm/tree/reactive/openstack_exporter.py?id=eda95420b14d30ceca7df3b67e2b277442005120#n126

    if config_creds_yaml:
        config_creds = yaml.safe_load(config_creds_yaml)
        creds = {
            'credentials_username': config_creds['username'],
            'credentials_password': config_creds['password'],
            'credentials_project': config_creds.get('tenant_name', 'admin'),
            'region': config_creds['region_name'],
            'auth_url': config_creds['auth_url'],
        }
        identity_api_version = config_creds.get('identity_api_version', 2)
        if identity_api_version == 3:
            creds['credentials_user_domain_name'] = config_creds['user_domain_name']
            creds['credentials_project_name'] = config_creds.get(
                'project_name', 'admin')
            creds['credentials_identity_api_version'] = identity_api_version
            creds['credentials_project_domain_name'] = config_creds.get(
                'project_domain_name', 'admin_domain')
            creds['credentials_project_id'] = config_creds['project_id']
            creds['credentials_project_domain_id'] = config_creds['project_domain_id']

Tags: cpe-onsite
Revision history for this message
Andrey Grebennikov (agrebennikov) wrote :

Also Charm description in the store has to be updated with the guidance how to properly use V3 credentials.

Xav Paice (xavpaice)
Changed in charm-prometheus-openstack-exporter:
status: New → Triaged
importance: Undecided → Medium
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.