[health_checks] Adding fallbacks for username lookups in:
health_checks.list_db_versions
- When environment is old, salt may not have pillars for
_param:<service>_db_username
Prod-Related: PROD-36191
Change-Id: I8e4cd7b2bf9436220d0b844b491c1ec7483c05b5
diff --git a/_modules/health_checks.py b/_modules/health_checks.py
index fab223c..6d70df3 100644
--- a/_modules/health_checks.py
+++ b/_modules/health_checks.py
@@ -2437,12 +2437,12 @@
keystone_db_pass = str(__salt__['pillar.get']('_param:mysql_keystone_password'))
neutron_db_pass = str(__salt__['pillar.get']('_param:mysql_neutron_password'))
nova_db_pass = str(__salt__['pillar.get']('_param:mysql_nova_password'))
- cinder_db_user = str(__salt__['pillar.get']('_param:mysql_cinder_username'))
- glance_db_user = str(__salt__['pillar.get']('_param:mysql_glance_username'))
- heat_db_user = str(__salt__['pillar.get']('_param:mysql_heat_username'))
- keystone_db_user = str(__salt__['pillar.get']('_param:mysql_keystone_username'))
- neutron_db_user = str(__salt__['pillar.get']('_param:mysql_neutron_username'))
- nova_db_user = str(__salt__['pillar.get']('_param:mysql_nova_username'))
+ cinder_db_user = str(__salt__['pillar.get']('_param:mysql_cinder_username', 'cinder'))
+ glance_db_user = str(__salt__['pillar.get']('_param:mysql_glance_username', 'glance'))
+ heat_db_user = str(__salt__['pillar.get']('_param:mysql_heat_username', 'heat'))
+ keystone_db_user = str(__salt__['pillar.get']('_param:mysql_keystone_username', 'keystone'))
+ neutron_db_user = str(__salt__['pillar.get']('_param:mysql_neutron_username', 'neutron'))
+ nova_db_user = str(__salt__['pillar.get']('_param:mysql_nova_username', 'nova'))
os_db_releases = {}
os_db_releases['cinder'] = get_cinder_db_versions(db_host, cinder_db_user, cinder_db_pass)