def set_options(opts): global options options = opts set_mysql_flavor(options.mysql_flavor) set_protocols_flavor(options.protocols_flavor) set_topo_server_flavor(options.topo_server_flavor)
def setup_protocol_flavor(flavor): """Imports the right protocols flavor implementation. This is a separate method that does dynamic import of the module so the tests only depend and import the code they will use. Each protocols flavor implementation will import the modules it needs. Args: flavor: the flavor name to use. """ if flavor == 'grpc': import grpc_protocols_flavor # pylint: disable=g-import-not-at-top protocols_flavor.set_protocols_flavor( grpc_protocols_flavor.GRpcProtocolsFlavor()) elif flavor == 'gorpc': import gorpc_protocols_flavor # pylint: disable=g-import-not-at-top protocols_flavor.set_protocols_flavor( gorpc_protocols_flavor.GoRpcProtocolsFlavor()) else: logging.error('Unknown protocols flavor %s', flavor) exit(1) logging.debug('Using protocols flavor \'%s\'', flavor)
def set_options(opts): global options options = opts set_mysql_flavor(options.mysql_flavor) set_protocols_flavor(options.protocols_flavor) set_topo_server_flavor(options.topo_server_flavor) environment.skip_build = options.skip_build