a >h@s^ddlZddlmZmZmZmZmZGdddeZGdddeeeZGdddeeZ dS) N)Plugin RedHatPlugin DebianPlugin UbuntuPlugin PluginOptc@sLeZdZdZdZdZeddddgZdZd Z d Z d d Z d dZ ddZ d S)OpenStackKeystonezOpenStack KeystoneZopenstack_keystone)Z openstackZopenstack_controllerZnopwTz!do not collect keystone passwords)defaultZdescz./var/lib/config-data/puppet-generated/keystoneNcCs&|dddd|jd|jd|jd|jd|jd |jd |jd g |d rn|d d|jdgn|dd|jdg|d}|d|_|ddks||jsd|_||jdddD}dddD}t|rt|s|j dn| d| d| dd d!dS)"Nz'/etc/keystone/default_catalog.templatesz/etc/keystone/keystone.confz/etc/keystone/logging.confz/etc/keystone/policy.jsonz/etc/keystone/*.confz/etc/keystone/*.jsonz/etc/httpd/conf//etc/httpd/conf.d/z /etc/httpd/conf.modules.d/*.confz/var/spool/cron/z/etc/my.cnf.d/tripleo.cnfZall_logsz/var/log/keystone/z /var/log/z */keystone*z/var/log/keystone/*.logz*/keystone*.logzDcrudini --get /etc/keystone/keystone.conf identity domain_config_diroutputstatusrz/etc/keystone/domainscSsg|]}|tjvqSosenviron.0pr r I/usr/lib/python3.9/site-packages/sos/report/plugins/openstack_keystone.py Dz+OpenStackKeystone.setup..)Z OS_USERNAMEZ OS_PASSWORDcSsg|]}|tjvqSr rrr r rrGr)ZOS_TENANT_NAMEZOS_PROJECT_NAMEz}Not all environment variables set. Source the environment file for the user intended to connect to the OpenStack environment.zopenstack endpoint listzopenstack catalog listZ keystone_confZ keystone_log)z.*/etc/keystone/keystone.confz/var/log/keystone/keystone.log) Z add_copy_specvar_puppet_genZ get_option apachepkgZcollect_cmd_outputdomain_config_dirZ path_isdirallanyZsoslogZwarningZadd_cmd_outputZ add_file_tags)selfZexec_outZvars_allZvars_anyr r rsetupsR         zOpenStackKeystone.setupcCs:|d||||jd||||jd||dS)z Apply regex substitution z/etc/keystone/*r N)do_path_regex_subr)rZregexpsubstr r rapply_regex_subWsz!OpenStackKeystone.apply_regex_subcCshgd}dg}d|}|dd|dd|d|dd||jdd|d d dS) N) passwordZ qpid_passwordZrabbit_passwordZssl_key_passwordZldap_dns_passwordZneutron_admin_passwordZ host_passwordZadmin_passwordZ admin_tokenZ ca_passwordZ transport_urlZOIDCClientSecretZ connection|z(^\s*(z)\s*(=\s*)?)(.*)z \1*********z!)\s*=\s*(.*)://(\w*):)(.*)(@(.*))z \1*********\6z )\s*=\s*)(.*)z \1********)joinr rr)rZ protect_keysZconnection_keysZ join_con_keysr r rpostproccs   zOpenStackKeystone.postproc)__name__ __module__ __qualname__Z short_descZ plugin_nameZprofilesrZ option_listrrrrr r$r r r rrs8 rc@seZdZdZdZdS)DebianKeystoneZapache2)Zkeystonezpython-keystonezpython3-keystoneNr%r&r'rZpackagesr r r rr(sr(c@seZdZdZdZdS)RedHatKeystoneZhttpd)zopenstack-selinuxNr)r r r rr*sr*) rZsos.report.pluginsrrrrrrr(r*r r r r sn