#!/usr/bin/env python import os.path, sys if not os.path.isfile('/etc/mock/default.cfg'): sys.stderr.write("This does not seem to be a Red Hat compatible OS.\n") exit(1) vars = { 'config_opts': {} } execfile("/etc/mock/default.cfg", vars) print(vars['config_opts']['dist'])