Пример #1
0
def get_cookie(config_path, name, domain, node_name=True):
    """Reads erlang cookie from file at config path.
    node_name = True means that argument name is a node name, otherwise
    it is a domain name.
    """
    if '@' in name:
        _, _, name = name.partition('@')
    if node_name:
        domain_name = name.split(".")[1]
    else:
        domain_name = name.split(".")[0]
    config = parse_json_config_file(config_path)
    cm_config = config[domain][domain_name]['cluster_manager']
    key = cm_config.keys()[0]
    return str(cm_config[key]['vm.args']['setcookie'])
Пример #2
0
    default=os.getcwd() + '/cluster_manager',
    help='the path to cluster_manager repository (precompiled)',
    dest='bin_cluster_manager')
parser.add_argument(
    '-do',
    '--domain',
    action='store',
    default='provider_domains',
    help='worker domain name, can be: provider_domains or cluster_domains',
    dest='domains_name')

# Prepare config
args = parser.parse_args()
dockers_config.ensure_image(args, 'image', 'worker')

config = common.parse_json_config_file(args.config_path)
output = {
    'cluster_manager_nodes': [],
    'cluster_worker_nodes': [],
}
uid = args.uid

# Start DNS
if args.dns == 'auto':
    [dns_server], dns_output = dns.maybe_start('auto', uid)
    common.merge(output, dns_output)
else:
    dns_server = args.dns

# Start cms
cm_output = cluster_manager.up(args.image, args.bin_cluster_manager,
Пример #3
0
parser.add_argument(
    '-bw', '--bin-worker',
    action='store',
    default=os.getcwd(),
    help='the path to oneprovider repository (precompiled)',
    dest='bin_op_worker')
parser.add_argument(
    '-bcm', '--bin-cm',
    action='store',
    default=os.getcwd() + '/cluster_manager',
    help='the path to cluster_manager repository (precompiled)',
    dest='bin_cluster_manager')

# Prepare config
args = parser.parse_args()
config = common.parse_json_config_file(args.config_path)
output = {
    'cluster_manager_nodes': [],
    'op_worker_nodes': [],
}
uid = args.uid

# Start DNS
if args.dns == 'auto':
    [dns_server], dns_output = dns.maybe_start('auto', uid)
    common.merge(output, dns_output)
else:
    dns_server = args.dns

# Start cms
cm_output = cluster_manager.up(args.image, args.bin_cluster_manager,
Пример #4
0
def get_storages(config_path, provider_id):
    config = parse_json_config_file(config_path)
    cfg = config['provider_domains'][provider_id]['os_config']
    return config['os_configs'][cfg]['storages']