Exemple #1
0
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)
Exemple #2
0
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)
Exemple #3
0
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)
Exemple #4
0
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)
Exemple #5
0
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
Exemple #6
0
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