# Check which group the user is in, and use the appropriate credentials file user = getpass.getuser() if user in grp.getgrnam("analytics-privatedata-users").gr_mem: option_file = "/etc/mysql/conf.d/analytics-research-client.cnf" elif user in grp.getgrnam("researchers").gr_mem: option_file = "/etc/mysql/conf.d/research-client.cnf" # For users in analytics-users, for example else: raise PermissionError( "Your account does not have permission to access the Analytics " "MariaDB cluster." )
We need system users like analytics-product to be able to run a notebook which uses wmfdata.mariadb to retrieve data. We need a way of pointing it to a cnf stored on HDFS, for example.