示例#1
0
文件: config.py 项目: takeratta/heron
def _list(cl_args):
  cluster = cl_args['cluster']
  config = cliconfig.cluster_config(cluster)
  if config:
    for k, v in config.items():
      print("%s = %s" % (str(k), str(v)))
  else:
    print("No config for cluster %s" % cluster)

  return SimpleResult(Status.Ok)
示例#2
0
def _list(cl_args):
    cluster = cl_args['cluster']
    config = cliconfig.cluster_config(cluster)
    if config:
        for k, v in list(config.items()):
            print(f"{str(k)} = {str(v)}")
    else:
        print(f"No config for cluster {cluster}")

    return SimpleResult(Status.Ok)
示例#3
0
def read_server_mode_cluster_definition(cluster, cl_args):
  '''
  Read the cluster definition for server mode
  :param cluster:
  :param cl_args:
  :param config_file:
  :return:
  '''

  client_confs = dict()
  client_confs[cluster] = cliconfig.cluster_config(cluster)

  # now check if the service-url from command line is set, if so override it
  if cl_args.get('service_url', None):
    client_confs[cluster]['service_url'] = cl_args['service_url']

  # the return value of yaml.load can be None if conf_file is an empty file
  # or there is no service-url in command line, if needed.

  return client_confs
示例#4
0
文件: cdefs.py 项目: ashvina/heron
def read_server_mode_cluster_definition(cluster, cl_args):
  '''
  Read the cluster definition for server mode
  :param cluster:
  :param cl_args:
  :param config_file:
  :return:
  '''

  client_confs = dict()
  client_confs[cluster] = cliconfig.cluster_config(cluster)

  # now check if the service-url from command line is set, if so override it
  if cl_args.get('service_url', None):
    client_confs[cluster]['service_url'] = cl_args['service_url']

  # the return value of yaml.load can be None if conf_file is an empty file
  # or there is no service-url in command line, if needed.

  return client_confs