def main(): if os.getuid() != 0: log.error('bootstrap must be run as root') sys.exit(1) opts = parse_args() logging.basicConfig(format='[%(levelname)s] %(message)s', level='INFO') log.setLevel(logging.DEBUG) log.info('Clearing proxy environment variables') for name in ['HTTP_PROXY', 'HTTPS_PROXY', 'NO_PROXY']: os.environ.pop(name, None) os.environ.pop(name.lower(), None) exhibitor.wait(opts.master_count) b = bootstrap.Bootstrapper(opts.zk) for service in opts.services: if service not in bootstrappers: log.error('Unknown service: {}'.format(service)) sys.exit(1) log.debug('bootstrapping {}'.format(service)) bootstrappers[service](b, opts)
def main(): opts = parse_args() # Display the pid in each log message to distinguish concurrent runs log_format = 'pid={}:[%(levelname)s] %(message)s'.format(os.getpid()) logging.basicConfig(format=log_format, level='INFO') log.setLevel(logging.DEBUG) log.info('Clearing proxy environment variables') for name in ['HTTP_PROXY', 'HTTPS_PROXY', 'NO_PROXY']: os.environ.pop(name, None) os.environ.pop(name.lower(), None) if 'master' in get_roles(): exhibitor.wait(opts.master_count) b = bootstrap.Bootstrapper(opts.zk) for service in opts.services: if service not in bootstrappers: log.error('Unknown service: {}'.format(service)) sys.exit(1) apply_service_configuration(service) log.info('bootstrapping {}'.format(service)) bootstrappers[service](b, opts)